CFE-27 fixed mocks bug

This commit is contained in:
AmirHossein Mahmoodi
2023-10-15 14:17:29 +03:30
parent b7d60d687f
commit 4ba0e92e8e
2 changed files with 23 additions and 9 deletions

View File

@@ -1,17 +1,28 @@
import {GET_PERMISSIONS_LIST, GET_ROLE_MANAGEMENT, GET_USER_ROUTE, SET_USER_PASSWORD} from "@/core/data/apiRoutes";
import {
GET_PERMISSIONS_LIST,
GET_ROLE_MANAGEMENT,
GET_SIDEBAR_NOTIFICATION,
GET_USER_ROUTE,
SET_USER_PASSWORD
} from "@/core/data/apiRoutes";
import {rest} from "msw";
export const handler = [
rest.get(GET_USER_ROUTE, (req, res, ctx) => {
return res(ctx.json({
data:{
data: {
id: 10,
permissions:[
permissions: [
"manage_users"
],
}
}))
}),
rest.get(GET_SIDEBAR_NOTIFICATION, (req, res, ctx) => {
return res(ctx.json({
data: []
}))
}),
rest.post(SET_USER_PASSWORD, (req, res, ctx) => {
return res(
ctx.status(200),
@@ -20,7 +31,7 @@ export const handler = [
rest.get(GET_PERMISSIONS_LIST, (req, res, ctx) => {
return res(ctx.json(
{
data:[
data: [
{
id: 1,
name: "manage_passenger_office_navgan",
@@ -29,7 +40,7 @@ export const handler = [
{
id: 2,
name: "manage_province_working_group_navgan",
name_fa:"مدیریت کارتابل کارگروه استانی"
name_fa: "مدیریت کارتابل کارگروه استانی"
}
]
}
@@ -39,7 +50,7 @@ export const handler = [
return res(
ctx.json(
{
data : [
data: [
{
created_at: "2023-10-01T07:20:07.000000Z",
guard_name: "api",
@@ -77,8 +88,8 @@ export const handler = [
updated_at: "2023-10-10T07:38:12.000000Z"
}
],
meta : {
totalRowCount : 2
meta: {
totalRowCount: 2
}
}
),