Feature: Add pin-creation from remote-url

+ Add CSRF protection for every request
This commit is contained in:
winkidney
2019-12-04 22:48:23 +08:00
committed by Isaac Bythewood
parent 5282ed5e53
commit bb24ed3ecf
9 changed files with 279 additions and 24 deletions

View File

@@ -3,6 +3,17 @@ import storage from './utils/storage';
const API_PREFIX = '/api/v2/';
const Pin = {
createFromURL(jsonData) {
const url = `${API_PREFIX}pins/`;
return axios.post(
url,
jsonData,
);
},
};
function fetchPins(offset, tagFilter, userFilter) {
const url = `${API_PREFIX}pins/`;
const queryArgs = {
@@ -160,6 +171,7 @@ const User = {
};
export default {
Pin,
fetchPin,
fetchPins,
fetchPinsForBoard,