@@ -0,0 +1,22 @@
|
||||
import { register } from '@/services/mock/registry'
|
||||
import { endpoints } from '@/services/api/endpoints'
|
||||
import { findOrThrow, updateById } from '@/services/mock/helpers'
|
||||
import { missionaryRequests } from '@/services/mock/fixtures/missionary-requests'
|
||||
|
||||
register('GET', endpoints.listMissionaryRequests, () => ({
|
||||
success: true,
|
||||
message: 'OK',
|
||||
data: missionaryRequests,
|
||||
}))
|
||||
|
||||
register('GET', endpoints.showMissionaryRequest, ({ params }) => ({
|
||||
success: true,
|
||||
message: 'OK',
|
||||
data: findOrThrow(missionaryRequests, params.id),
|
||||
}))
|
||||
|
||||
register('PATCH', endpoints.changeMissionaryRequestStatus, ({ params, data }) => ({
|
||||
success: true,
|
||||
message: 'Status updated.',
|
||||
data: updateById(missionaryRequests, params.id, { status: data.status }),
|
||||
}))
|
||||
Reference in New Issue
Block a user