add invite handlers
This commit is contained in:
@@ -6,6 +6,7 @@ import { handlers as enableHandlers } from './enable.handlers.js';
|
||||
import { handlers as disableHandlers } from './disable.handlers.js';
|
||||
import { handlers as changePasswordHandlers } from './change-password.handlers.js';
|
||||
import { handlers as unlockHandlers } from './unlock.handlers.js';
|
||||
import { handlers as inviteHandlers } from './invite.handlers.js';
|
||||
|
||||
export const handlers = [
|
||||
...itemHandlers,
|
||||
@@ -16,4 +17,5 @@ export const handlers = [
|
||||
...changePasswordHandlers,
|
||||
...unlockHandlers,
|
||||
...detailHandlers,
|
||||
...inviteHandlers,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
const { rest } = window.MockServiceWorker;
|
||||
import { umbUsersData } from '../../data/user.data.js';
|
||||
import { slug } from './slug.js';
|
||||
import { InviteUserRequestModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import { umbracoPath } from '@umbraco-cms/backoffice/utils';
|
||||
|
||||
export const handlers = [
|
||||
rest.post<InviteUserRequestModel>(umbracoPath(`${slug}/invite`), async (req, res, ctx) => {
|
||||
const data = await req.json();
|
||||
if (!data) return;
|
||||
|
||||
umbUsersData.invite(data);
|
||||
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
|
||||
rest.post<any>(umbracoPath(`${slug}/invite/resend`), async (req, res, ctx) => {
|
||||
const data = await req.json();
|
||||
if (!data) return;
|
||||
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
];
|
||||
Reference in New Issue
Block a user