don't return anything when deleting
This commit is contained in:
@@ -151,9 +151,9 @@ export const handlers = [
|
||||
const id = req.params.id as string;
|
||||
if (!id) return;
|
||||
|
||||
const deletedKeys = umbDictionaryData.delete([id]);
|
||||
umbDictionaryData.delete([id]);
|
||||
|
||||
return res(ctx.status(200), ctx.json(deletedKeys));
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
|
||||
// TODO => handle properly, querystring breaks handler
|
||||
@@ -165,7 +165,7 @@ export const handlers = [
|
||||
const item = umbDictionaryData.getById(id);
|
||||
|
||||
alert(
|
||||
`Downloads file for dictionary "${item?.name}", ${includeChildren === 'true' ? 'with' : 'without'} children.`
|
||||
`Downloads file for dictionary "${item?.name}", ${includeChildren === 'true' ? 'with' : 'without'} children.`,
|
||||
);
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
|
||||
@@ -45,16 +45,17 @@ const detailHandlers: RestHandler<MockedRequest<DefaultBodyType>>[] = [
|
||||
rest.delete(umbracoPath('/partial-view'), (req, res, ctx) => {
|
||||
const path = req.url.searchParams.get('path');
|
||||
if (!path) return res(ctx.status(400));
|
||||
const response = umbPartialViewsData.delete([path]);
|
||||
return res(ctx.status(200), ctx.json(response));
|
||||
umbPartialViewsData.delete([path]);
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
|
||||
rest.put(umbracoPath('/partial-view'), (req, res, ctx) => {
|
||||
const requestBody = req.json() as CreateTextFileViewModelBaseModel;
|
||||
if (!requestBody) return res(ctx.status(400, 'no body found'));
|
||||
const response = umbPartialViewsData.updateData(requestBody);
|
||||
umbPartialViewsData.updateData(requestBody);
|
||||
return res(ctx.status(200));
|
||||
}),
|
||||
];
|
||||
const folderHandlers: RestHandler<MockedRequest<DefaultBodyType>>[] = [];
|
||||
|
||||
export const handlers = [...treeHandlers, ...detailHandlers, ...folderHandlers]
|
||||
export const handlers = [...treeHandlers, ...detailHandlers, ...folderHandlers];
|
||||
|
||||
Reference in New Issue
Block a user