From ec001fe1d286628d9b4dd6b7db49431f0c5c8e2b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 6 Sep 2021 10:19:01 +0200 Subject: [PATCH] Fix Create. --- backend/i18n/frontend_en.json | 2 +- backend/i18n/frontend_it.json | 2 +- backend/i18n/frontend_nl.json | 2 +- backend/i18n/frontend_zh.json | 2 +- backend/i18n/source/frontend_en.json | 2 +- frontend/app/shared/services/contents.service.ts | 4 ++-- frontend/app/shared/state/contents.state.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 0b0b4f5bf..fc3bb9f06 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -241,7 +241,7 @@ "common.create": "Create", "common.created": "Created", "common.daily": "Daily", - "common.dashboard": "Dasboard", + "common.dashboard": "Dashboard", "common.date": "Date", "common.dateTimeEditor.local": "Local", "common.dateTimeEditor.now": "Now", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 499f00d98..30401374a 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -241,7 +241,7 @@ "common.create": "Crea", "common.created": "Creato", "common.daily": "Daily", - "common.dashboard": "Dasboard", + "common.dashboard": "Dashboard", "common.date": "Data", "common.dateTimeEditor.local": "Locale", "common.dateTimeEditor.now": "Data e Ora attuale", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index ca9c5311c..446d992f3 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -241,7 +241,7 @@ "common.create": "Maken", "common.created": "Gemaakt", "common.daily": "Daily", - "common.dashboard": "Dasboard", + "common.dashboard": "Dashboard", "common.date": "Datum", "common.dateTimeEditor.local": "Lokaal", "common.dateTimeEditor.now": "Nu", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index bb8fb1e63..7df1c2a04 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -241,7 +241,7 @@ "common.create": "创建", "common.created": "创建", "common.daily": "Daily", - "common.dashboard": "Dasboard", + "common.dashboard": "Dashboard", "common.date": "日期", "common.dateTimeEditor.local": "本地", "common.dateTimeEditor.now": "现在", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 0b0b4f5bf..fc3bb9f06 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -241,7 +241,7 @@ "common.create": "Create", "common.created": "Created", "common.daily": "Daily", - "common.dashboard": "Dasboard", + "common.dashboard": "Dashboard", "common.date": "Date", "common.dateTimeEditor.local": "Local", "common.dateTimeEditor.now": "Now", diff --git a/frontend/app/shared/services/contents.service.ts b/frontend/app/shared/services/contents.service.ts index 06ae7a6fb..ff165c94f 100644 --- a/frontend/app/shared/services/contents.service.ts +++ b/frontend/app/shared/services/contents.service.ts @@ -232,8 +232,8 @@ export class ContentsService { pretifyError('i18n:contents.loadDataFailed')); } - public postContent(appName: string, schemaName: string, data: any, publish: boolean, id?: string): Observable { - const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?publish=${publish}&id=${id}`); + public postContent(appName: string, schemaName: string, data: any, publish: boolean, id = ''): Observable { + const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?publish=${publish}&id=${id ?? ''}`); return HTTP.postVersioned(this.http, url, data).pipe( map(({ payload }) => { diff --git a/frontend/app/shared/state/contents.state.ts b/frontend/app/shared/state/contents.state.ts index b22f23850..367fbb531 100644 --- a/frontend/app/shared/state/contents.state.ts +++ b/frontend/app/shared/state/contents.state.ts @@ -219,7 +219,7 @@ export abstract class ContentsStateBase extends State { shareSubscribed(this.dialogs)); } - public create(data: any, publish: boolean, id?: string): Observable { + public create(data: any, publish: boolean, id = ''): Observable { return this.contentsService.postContent(this.appName, this.schemaName, data, publish, id).pipe( tap(payload => { this.dialogs.notifyInfo('i18n:contents.created');