Browse Source

Fix Create.

pull/758/head
Sebastian 4 years ago
parent
commit
ec001fe1d2
  1. 2
      backend/i18n/frontend_en.json
  2. 2
      backend/i18n/frontend_it.json
  3. 2
      backend/i18n/frontend_nl.json
  4. 2
      backend/i18n/frontend_zh.json
  5. 2
      backend/i18n/source/frontend_en.json
  6. 4
      frontend/app/shared/services/contents.service.ts
  7. 2
      frontend/app/shared/state/contents.state.ts

2
backend/i18n/frontend_en.json

@ -241,7 +241,7 @@
"common.create": "Create", "common.create": "Create",
"common.created": "Created", "common.created": "Created",
"common.daily": "Daily", "common.daily": "Daily",
"common.dashboard": "Dasboard", "common.dashboard": "Dashboard",
"common.date": "Date", "common.date": "Date",
"common.dateTimeEditor.local": "Local", "common.dateTimeEditor.local": "Local",
"common.dateTimeEditor.now": "Now", "common.dateTimeEditor.now": "Now",

2
backend/i18n/frontend_it.json

@ -241,7 +241,7 @@
"common.create": "Crea", "common.create": "Crea",
"common.created": "Creato", "common.created": "Creato",
"common.daily": "Daily", "common.daily": "Daily",
"common.dashboard": "Dasboard", "common.dashboard": "Dashboard",
"common.date": "Data", "common.date": "Data",
"common.dateTimeEditor.local": "Locale", "common.dateTimeEditor.local": "Locale",
"common.dateTimeEditor.now": "Data e Ora attuale", "common.dateTimeEditor.now": "Data e Ora attuale",

2
backend/i18n/frontend_nl.json

@ -241,7 +241,7 @@
"common.create": "Maken", "common.create": "Maken",
"common.created": "Gemaakt", "common.created": "Gemaakt",
"common.daily": "Daily", "common.daily": "Daily",
"common.dashboard": "Dasboard", "common.dashboard": "Dashboard",
"common.date": "Datum", "common.date": "Datum",
"common.dateTimeEditor.local": "Lokaal", "common.dateTimeEditor.local": "Lokaal",
"common.dateTimeEditor.now": "Nu", "common.dateTimeEditor.now": "Nu",

2
backend/i18n/frontend_zh.json

@ -241,7 +241,7 @@
"common.create": "创建", "common.create": "创建",
"common.created": "创建", "common.created": "创建",
"common.daily": "Daily", "common.daily": "Daily",
"common.dashboard": "Dasboard", "common.dashboard": "Dashboard",
"common.date": "日期", "common.date": "日期",
"common.dateTimeEditor.local": "本地", "common.dateTimeEditor.local": "本地",
"common.dateTimeEditor.now": "现在", "common.dateTimeEditor.now": "现在",

2
backend/i18n/source/frontend_en.json

@ -241,7 +241,7 @@
"common.create": "Create", "common.create": "Create",
"common.created": "Created", "common.created": "Created",
"common.daily": "Daily", "common.daily": "Daily",
"common.dashboard": "Dasboard", "common.dashboard": "Dashboard",
"common.date": "Date", "common.date": "Date",
"common.dateTimeEditor.local": "Local", "common.dateTimeEditor.local": "Local",
"common.dateTimeEditor.now": "Now", "common.dateTimeEditor.now": "Now",

4
frontend/app/shared/services/contents.service.ts

@ -232,8 +232,8 @@ export class ContentsService {
pretifyError('i18n:contents.loadDataFailed')); pretifyError('i18n:contents.loadDataFailed'));
} }
public postContent(appName: string, schemaName: string, data: any, publish: boolean, id?: string): Observable<ContentDto> { public postContent(appName: string, schemaName: string, data: any, publish: boolean, id = ''): Observable<ContentDto> {
const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?publish=${publish}&id=${id}`); const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?publish=${publish}&id=${id ?? ''}`);
return HTTP.postVersioned(this.http, url, data).pipe( return HTTP.postVersioned(this.http, url, data).pipe(
map(({ payload }) => { map(({ payload }) => {

2
frontend/app/shared/state/contents.state.ts

@ -219,7 +219,7 @@ export abstract class ContentsStateBase extends State<Snapshot> {
shareSubscribed(this.dialogs)); shareSubscribed(this.dialogs));
} }
public create(data: any, publish: boolean, id?: string): Observable<ContentDto> { public create(data: any, publish: boolean, id = ''): Observable<ContentDto> {
return this.contentsService.postContent(this.appName, this.schemaName, data, publish, id).pipe( return this.contentsService.postContent(this.appName, this.schemaName, data, publish, id).pipe(
tap(payload => { tap(payload => {
this.dialogs.notifyInfo('i18n:contents.created'); this.dialogs.notifyInfo('i18n:contents.created');

Loading…
Cancel
Save