Refactor account and evaluations routes to use POST for billing and run-again endpoints
- Changed the billing route from GET to POST in account.route.ts and account.api.js for consistency with other account actions. - Updated the run-again route from GET to POST in evaluations/index.ts and evaluations.js to align with the API design for creating actions.
This commit is contained in:
parent
910a3c5229
commit
373625b021
|
|
@ -30,7 +30,7 @@ router.post('/reset-password', accountController.resetPassword)
|
||||||
|
|
||||||
router.post('/cancel-subscription', accountController.cancelPreviousCloudSubscrption)
|
router.post('/cancel-subscription', accountController.cancelPreviousCloudSubscrption)
|
||||||
|
|
||||||
router.get('/billing', accountController.createStripeCustomerPortalSession)
|
router.post('/billing', accountController.createStripeCustomerPortalSession)
|
||||||
|
|
||||||
router.get('/basic-auth', accountController.getBasicAuth)
|
router.get('/basic-auth', accountController.getBasicAuth)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ router.get('/:id', checkPermission('evaluations:view'), evaluationsController.ge
|
||||||
router.delete('/:id', checkPermission('evaluations:delete'), evaluationsController.deleteEvaluation)
|
router.delete('/:id', checkPermission('evaluations:delete'), evaluationsController.deleteEvaluation)
|
||||||
router.post('/', checkPermission('evaluations:create'), evaluationsController.createEvaluation)
|
router.post('/', checkPermission('evaluations:create'), evaluationsController.createEvaluation)
|
||||||
router.get('/is-outdated/:id', evaluationsController.isOutdated)
|
router.get('/is-outdated/:id', evaluationsController.isOutdated)
|
||||||
router.get('/run-again/:id', checkAnyPermission('evaluations:create,evaluations:run'), evaluationsController.runAgain)
|
router.post('/run-again/:id', checkAnyPermission('evaluations:create,evaluations:run'), evaluationsController.runAgain)
|
||||||
router.get('/versions/:id', checkPermission('evaluations:view'), evaluationsController.getVersions)
|
router.get('/versions/:id', checkPermission('evaluations:view'), evaluationsController.getVersions)
|
||||||
router.patch('/', checkPermission('evaluations:delete'), evaluationsController.patchDeleteEvaluations)
|
router.patch('/', checkPermission('evaluations:delete'), evaluationsController.patchDeleteEvaluations)
|
||||||
export default router
|
export default router
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const verifyAccountEmail = (body) => client.post('/account/verify', body)
|
||||||
const resendVerificationEmail = (body) => client.post('/account/resend-verification', body)
|
const resendVerificationEmail = (body) => client.post('/account/resend-verification', body)
|
||||||
const forgotPassword = (body) => client.post('/account/forgot-password', body)
|
const forgotPassword = (body) => client.post('/account/forgot-password', body)
|
||||||
const resetPassword = (body) => client.post('/account/reset-password', body)
|
const resetPassword = (body) => client.post('/account/reset-password', body)
|
||||||
const getBillingData = () => client.get('/account/billing')
|
const getBillingData = () => client.post('/account/billing')
|
||||||
const cancelSubscription = (body) => client.post('/account/cancel-subscription', body)
|
const cancelSubscription = (body) => client.post('/account/cancel-subscription', body)
|
||||||
const logout = () => client.post('/account/logout')
|
const logout = () => client.post('/account/logout')
|
||||||
const getBasicAuth = () => client.get('/account/basic-auth')
|
const getBasicAuth = () => client.get('/account/basic-auth')
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const getIsOutdated = (id) => client.get(`/evaluations/is-outdated/${id}`)
|
||||||
const getEvaluation = (id) => client.get(`/evaluations/${id}`)
|
const getEvaluation = (id) => client.get(`/evaluations/${id}`)
|
||||||
const createEvaluation = (body) => client.post(`/evaluations`, body)
|
const createEvaluation = (body) => client.post(`/evaluations`, body)
|
||||||
const deleteEvaluation = (id) => client.delete(`/evaluations/${id}`)
|
const deleteEvaluation = (id) => client.delete(`/evaluations/${id}`)
|
||||||
const runAgain = (id) => client.get(`/evaluations/run-again/${id}`)
|
const runAgain = (id) => client.post(`/evaluations/run-again/${id}`)
|
||||||
const getVersions = (id) => client.get(`/evaluations/versions/${id}`)
|
const getVersions = (id) => client.get(`/evaluations/versions/${id}`)
|
||||||
const deleteEvaluations = (ids, isDeleteAllVersion) => client.patch(`/evaluations`, { ids, isDeleteAllVersion })
|
const deleteEvaluations = (ids, isDeleteAllVersion) => client.patch(`/evaluations`, { ids, isDeleteAllVersion })
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue