Feature: Add single pin display and share link for pin

This commit is contained in:
winkidney
2019-11-30 15:06:29 +08:00
committed by Isaac Bythewood
parent d7e89050a0
commit 133cd93d94
6 changed files with 46 additions and 13 deletions

View File

@@ -19,6 +19,28 @@ function fetchPins(offset, tagFilter, userFilter) {
);
}
function fetchPin(pinId) {
const url = `${API_PREFIX}pins/${pinId}`;
return new Promise(
(resolve, reject) => {
const p = axios.get(
url,
);
p.then(
(resp) => {
const response = {
data: { results: [resp.data], next: null },
};
resolve(response);
},
(error) => {
reject(error);
},
);
},
);
}
function fetchPinsForBoard(boardId) {
const url = `${API_PREFIX}boards/${boardId}`;
return new Promise(
@@ -103,6 +125,7 @@ const User = {
};
export default {
fetchPin,
fetchPins,
fetchPinsForBoard,
User,