CFE-27 fixed mocks bug
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
),
|
||||
|
||||
@@ -16,7 +16,10 @@ export const SET_USER_PASSWORD = BASE_URL + "/api/profile/change_password";
|
||||
export const GET_USER_ROUTE = BASE_URL + "/api/profile/info";
|
||||
//user data
|
||||
|
||||
export const GET_SIDEBAR_NOTIFICATION = BASE_URL + "";
|
||||
//sidebar notification
|
||||
export const GET_SIDEBAR_NOTIFICATION = BASE_URL + "/dashboard/notification"
|
||||
//sidebar notification
|
||||
|
||||
|
||||
// role management
|
||||
export const GET_ROLE_MANAGEMENT =
|
||||
|
||||
Reference in New Issue
Block a user