Files
Frontend/mocks/handler.js
Mohammad Jalali d38b12aa85 CFE-3 complete Submission part of testing for CreateForm And
CreateContent component

ubmission part of testing for CreateForm And CreateContent component

:q
2023-10-16 14:14:30 +03:30

47 lines
1.2 KiB
JavaScript

import {CREATE_EXPERT_MANAGEMENT, GET_PROVINCE_LIST, GET_ROLE_LIST, GET_USER_ROUTE} from "@/core/data/apiRoutes";
import {rest} from "msw";
export const handler = [
rest.get(GET_USER_ROUTE, (req, res, ctx) => {
return res(ctx.json({
data: {
id: 10
}
}))
}),
rest.get(GET_PROVINCE_LIST, (req, res, ctx) => {
return res(ctx.json({
data: [
{
id: 1,
name: "آذربایجان شرقی"
},
{
id: 3,
name: "اردبیل"
}
]
}))
}),
rest.get(GET_ROLE_LIST, (req, res, ctx) => {
return res(ctx.json({
data: [
{
id: 1,
name: "admin",
name_fa: "ادمین"
},
{
id: 2,
name: "manager",
name_fa: "مدیر"
}
]
}))
}),
rest.post(CREATE_EXPERT_MANAGEMENT, (req, res, ctx) => {
return res(
ctx.status(200),
);
}),
]