Skip to content

Commit 88513a9

Browse files
Added Endpoints
1 parent ec6878f commit 88513a9

5 files changed

Lines changed: 68 additions & 0 deletions

File tree

Source/Endpoints/Avatar.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
import { avatars } from './Base.js'
3+
4+
5+
6+
export const build
7+
= `${ avatars }/build`;

Source/Endpoints/Base.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
export const domain
4+
= 'https://devrant.com/api/devrant';
5+
6+
export const rants
7+
= `${ domain }/rants`;
8+
9+
export const random
10+
= `${ rants }/surprise`;
11+
12+
export const users
13+
= `${ domain }/users`
14+
15+
export const avatars
16+
= `${ domain }/avatars`

Source/Endpoints/Rant.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import { rants } from './Base.js'
3+
4+
5+
export const rant = ( id ) =>
6+
`${ rants }/${ id }`;
7+
8+
export const unfavorite = ( id ) =>
9+
`${ rant(id) }/unfavorite`;
10+
11+
export const favorite = ( id ) =>
12+
`${ rant(id) }/favorite`;
13+
14+
export const comment = ( id ) =>
15+
`${ rant(id) }/comments`;
16+
17+
export const vote = ( id ) =>
18+
`${ rant(id) }/vote`;

Source/Endpoints/User.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
import { users } from './Base.js'
3+
4+
5+
export const user = ( id ) =>
6+
`${ users }/${ id }`;
7+
8+
export const edit
9+
= `${ users }/me/edit-profile`;
10+
11+
export const authenticate
12+
= `${ users }/auth-token`;
13+
14+
export const notifications
15+
= `${ users }/me/notif-feed`;
16+
17+
export const avatar
18+
= `${ users }/me/avatar`;
19+
20+
export const subscribe = ( id ) =>
21+
`${ user(id) }/subscribe`;
22+
23+
export const unsubscribe = ( id ) =>
24+
`${ user(id) }/subscribe`;

Source/Endpoints/mod.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
export * as rant from './Rant.js'
3+
export * as user from './User.js'

0 commit comments

Comments
 (0)