Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @flow
- export class ApiCall {
- constructor(url: string) {
- this.url = url;
- }
- get = (id?: string) => app.api.get(id ? `${this.url}/${id}` : this.url);
- post = (body: object = {}) => app.api.post(body);
- put = (body: object = {}) => app.api.put(body);
- delete = (id?: string) => app.api.delete(`${this.url}/${id}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement