Compare commits

...

1 Commits

Author SHA1 Message Date
Henry 373625b021 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.
2025-07-22 15:38:19 +01:00
4 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ router.post('/reset-password', accountController.resetPassword)
router.post('/cancel-subscription', accountController.cancelPreviousCloudSubscrption)
router.get('/billing', accountController.createStripeCustomerPortalSession)
router.post('/billing', accountController.createStripeCustomerPortalSession)
router.get('/basic-auth', accountController.getBasicAuth)

View File

@ -8,7 +8,7 @@ router.get('/:id', checkPermission('evaluations:view'), evaluationsController.ge
router.delete('/:id', checkPermission('evaluations:delete'), evaluationsController.deleteEvaluation)
router.post('/', checkPermission('evaluations:create'), evaluationsController.createEvaluation)
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.patch('/', checkPermission('evaluations:delete'), evaluationsController.patchDeleteEvaluations)
export default router

View File

@ -6,7 +6,7 @@ const verifyAccountEmail = (body) => client.post('/account/verify', body)
const resendVerificationEmail = (body) => client.post('/account/resend-verification', body)
const forgotPassword = (body) => client.post('/account/forgot-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 logout = () => client.post('/account/logout')
const getBasicAuth = () => client.get('/account/basic-auth')

View File

@ -6,7 +6,7 @@ const getIsOutdated = (id) => client.get(`/evaluations/is-outdated/${id}`)
const getEvaluation = (id) => client.get(`/evaluations/${id}`)
const createEvaluation = (body) => client.post(`/evaluations`, body)
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 deleteEvaluations = (ids, isDeleteAllVersion) => client.patch(`/evaluations`, { ids, isDeleteAllVersion })