Skip to content

Commit

Permalink
fix: bookmark api body
Browse files Browse the repository at this point in the history
  • Loading branch information
ptyoiy committed Jul 3, 2024
1 parent 20dbeb8 commit b63b65e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/api/axios/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ interface EventMutation {
export interface EventLikeRequest extends EventMutation {
like: 'like' | 'dislike' | null
}
export interface EventBookmarkRequest extends EventMutation {
fcmToken: string;
}

export function getEvents() {
console.log('get Events called');
return axios.get('/posts/events').then((res) => res.data);
Expand All @@ -33,16 +37,16 @@ export function setEventLike({ id, user_id, like }: EventLikeRequest) {
});
}

export function setBookmark({ id, user_id }: EventMutation) {
export function setBookmark({ id, user_id, fcmToken }: EventBookmarkRequest) {
console.log('set event Bookmark');
return axios.post('/users/bookmark/add', {
event_id: id, user_id
event_id: id, user_id, fcmToken
});
}

export function delBookmark({ id, user_id }: EventMutation) {
export function delBookmark({ id, user_id, fcmToken }: EventBookmarkRequest) {
console.log('del event Bookmark');
return axios.post('/users/bookmark/remove', {
event_id: id, user_id
event_id: id, user_id, fcmToken
});
}

0 comments on commit b63b65e

Please sign in to comment.