1- import axios from 'axios'
2-
3- export const forms = http => ( {
1+ export default http => ( {
42 list : args => getForms ( http , args ) ,
53 get : args => getForm ( http , args ) ,
64 update : args => updateForm ( http , args ) ,
@@ -12,7 +10,7 @@ export const forms = http => ({
1210 }
1311} )
1412
15- export const getForms = ( http , { page, page_size, search } = { } ) => {
13+ const getForms = ( http , { page, page_size, search } = { } ) => {
1614 return http . request ( {
1715 method : 'get' ,
1816 url : `/forms` ,
@@ -22,14 +20,14 @@ export const getForms = (http, { page, page_size, search } = {}) => {
2220 } )
2321}
2422
25- export const getForm = ( http , { uid } ) => {
23+ const getForm = ( http , { uid } ) => {
2624 return http . request ( {
2725 method : 'get' ,
2826 url : `/forms/${ uid } `
2927 } )
3028}
3129
32- export const updateForm = ( http , { uid, override, data } = { } ) => {
30+ const updateForm = ( http , { uid, override, data } = { } ) => {
3331 let methodType = 'patch'
3432 if ( override ) {
3533 methodType = 'put'
@@ -42,29 +40,29 @@ export const updateForm = (http, { uid, override, data } = {}) => {
4240 } )
4341}
4442
45- export const createForm = ( http , { data } = { } ) => {
43+ const createForm = ( http , { data } = { } ) => {
4644 return http . request ( {
4745 method : 'post' ,
4846 url : `/forms` ,
4947 data
5048 } )
5149}
5250
53- export const deleteForm = ( http , { uid } ) => {
51+ const deleteForm = ( http , { uid } ) => {
5452 return http . request ( {
5553 method : 'delete' ,
5654 url : `/forms/${ uid } `
5755 } )
5856}
5957
60- export const getMessages = ( http , { uid } ) => {
58+ const getMessages = ( http , { uid } ) => {
6159 return http . request ( {
6260 method : 'get' ,
6361 url : `/forms/${ uid } /messages`
6462 } )
6563}
6664
67- export const updateMessages = ( http , { uid, data } ) => {
65+ const updateMessages = ( http , { uid, data } ) => {
6866 return http . request ( {
6967 method : 'put' ,
7068 url : `/forms/${ uid } /messages` ,
0 commit comments