fix user handler

This commit is contained in:
Jesper Møller Jensen
2023-05-01 18:27:18 +12:00
parent fee6c6fb90
commit bbb2bb9a54

View File

@@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
import { umbUsersData } from '../data/users.data';
import { umbracoPath } from '@umbraco-cms/backoffice/utils';
const slug = '/users';
const slug = '/user';
export const handlers = [
rest.get(umbracoPath(`${slug}`), (req, res, ctx) => {
@@ -13,6 +13,13 @@ export const handlers = [
return res(ctx.status(200), ctx.json(response));
}),
rest.get(umbracoPath(`${slug}/filter`), (req, res, ctx) => {
//TODO: Implementer filter
const response = umbUsersData.getAll();
return res(ctx.status(200), ctx.json(response));
}),
rest.get(umbracoPath(`${slug}/:id`), (req, res, ctx) => {
const id = req.params.id as string;
if (!id) return;