1 | /* eslint-disable no-unused-vars */ |
||
2 | import fatum from 'fatum'; |
||
3 | |||
4 | const METHODS = [ 'GET', 'PATCH', 'POST', 'PUT', 'OPTIONS', 'HEAD', 'DELETE' ]; |
||
5 | const GROUPS = [ 'users', 'posts', 'externals', 'messages' ]; |
||
6 | const TITLES = { |
||
7 | users : [ 'create user', 'update user', 'delete user', 'show user' ], |
||
8 | posts : [ 'create post', 'update post', 'delete post', 'show post' ], |
||
9 | messages : [ 'create message', 'update message', 'delete message', 'show message' ], |
||
10 | externals : [ 'heath', 'info', 'help', 'contacts' ] |
||
11 | }; |
||
12 | |||
13 | export function actionGenerate() { |
||
14 | const method = fatum.pick(METHODS); |
||
0 ignored issues
–
show
Unused Code
introduced
by
![]() |
|||
15 | const url = fatum.domain(); |
||
0 ignored issues
–
show
|
|||
16 | const group = fatum.pick(GROUPS); |
||
17 | const title = fatum.pick(TITLES[group]); |
||
0 ignored issues
–
show
|
|||
18 | } |
||
19 | |||
20 | export function generateActions(count = 100, options = {}) { |
||
21 | return Array.from({ length: count }).map(() => actionGenerate()); |
||
22 | } |
||
23 | |||
24 | export function AxiosCollection(baseUrl) {} |
||
0 ignored issues
–
show
|
|||
25 | |||
26 | export function generateAxiosRequest(baseUrl, { method, query, path } = {}) { |
||
27 | return { |
||
28 | method : method.toUpperCase(), |
||
29 | url : baseUrl + path |
||
30 | }; |
||
31 | } |
||
32 |