rename content handlers to node handlers

This commit is contained in:
Mads Rasmussen
2022-08-29 16:35:52 +02:00
parent c73074dc7c
commit baa936e5d4
4 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ export class UmbNodeStore {
getByKey(key: string): Observable<NodeEntity | null> {
// fetch from server and update store
fetch(`/umbraco/backoffice/content/${key}`)
fetch(`/umbraco/backoffice/node/${key}`)
.then((res) => res.json())
.then((data) => {
this._updateStore(data);
@@ -40,7 +40,7 @@ export class UmbNodeStore {
}
// TODO: Use node type to hit the right API, or have a general Node API?
return fetch('/umbraco/backoffice/content/save', {
return fetch('/umbraco/backoffice/node/save', {
method: 'POST',
body: body,
headers: {

View File

@@ -1,4 +1,4 @@
import { handlers as contentHandlers } from './domains/content.handlers';
import { handlers as contentHandlers } from './domains/node.handlers';
import { handlers as dataTypeHandlers } from './domains/data-type.handlers';
import { handlers as documentTypeHandlers } from './domains/document-type.handlers';
import { handlers as installHandlers } from './domains/install.handlers';

View File

@@ -4,7 +4,7 @@ import { NodeEntity, umbNodeData } from '../data/node.data';
// TODO: add schema
export const handlers = [
rest.get('/umbraco/backoffice/content/:key', (req, res, ctx) => {
rest.get('/umbraco/backoffice/node/:key', (req, res, ctx) => {
console.warn('Please move to schema');
const key = req.params.key as string;
if (!key) return;
@@ -14,7 +14,7 @@ export const handlers = [
return res(ctx.status(200), ctx.json([document]));
}),
rest.post<NodeEntity[]>('/umbraco/backoffice/content/save', (req, res, ctx) => {
rest.post<NodeEntity[]>('/umbraco/backoffice/node/save', (req, res, ctx) => {
console.warn('Please move to schema');
const data = req.body;
if (!data) return;

View File

@@ -1,4 +1,4 @@
import { handlers as contentHandlers } from './domains/content.handlers';
import { handlers as contentHandlers } from './domains/node.handlers';
import { handlers as dataTypeHandlers } from './domains/data-type.handlers';
import { handlers as documentTypeHandlers } from './domains/document-type.handlers';
import { handlers as installHandlers } from './domains/install.handlers';