Skip to content

Commit

Permalink
feat: add Shots api
Browse files Browse the repository at this point in the history
  • Loading branch information
animify committed Feb 9, 2020
1 parent 2b4bb4e commit 0587b37
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/Dribbble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,43 @@ export default class Dribbble {
},
};
}

public static get shots() {
return {
list: () => {
return Request.fetch({ url: '/user/shots', method: 'GET' });
},
get: (id: string) => {
return Request.fetch({ url: `/shots/${id}`, method: 'GET' });
},
create: (body: {
image: File;
title: string;
description?: string;
low_profile?: boolean;
rebound_source_id?: number;
scheduled_for?: number;
tags?: string[];
team_id?: number;
}) => {
return Request.fetch({ url: `/shots`, method: 'POST', body });
},
update: (
id: string,
body: {
title?: string;
description?: string;
low_profile?: boolean;
scheduled_for?: number;
tags?: string[];
team_id?: number;
},
) => {
return Request.fetch({ url: `/shots/${id}`, method: 'PUT', body });
},
delete: (id: string) => {
return Request.fetch({ url: `/shots/${id}`, method: 'DELETE' });
},
};
}
}

0 comments on commit 0587b37

Please sign in to comment.