From f7eeaa342acfa912de8db9472d6a29217a16ec68 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 4 Jan 2024 15:41:42 +0100 Subject: [PATCH] hotfix usuwania scenerii & changeloga --- src/components/TableActions.vue | 2 +- src/mixins/changeMixin.ts | 4 ++-- src/types/types.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/TableActions.vue b/src/components/TableActions.vue index a301af8..04885f7 100644 --- a/src/components/TableActions.vue +++ b/src/components/TableActions.vue @@ -115,7 +115,7 @@ export default defineComponent({ async updateListToDb() { try { const mappedChangeList = this.store.changeList.map((v) => { - if (/^#/.test(v.id)) { + if (/^#/.test(v.id.toString())) { return { ...v, id: undefined }; } return { ...v }; diff --git a/src/mixins/changeMixin.ts b/src/mixins/changeMixin.ts index 44b215e..c6eed4b 100644 --- a/src/mixins/changeMixin.ts +++ b/src/mixins/changeMixin.ts @@ -39,8 +39,8 @@ export default defineComponent({ const sceneryId = sceneryData.id; // Sceneria niewpisana do bazy danych (id stworzone przez stronÄ™) - if (sceneryId.startsWith('#')) { - this.store.changeList.filter((item) => item.id != sceneryId); + if (sceneryId.toString().startsWith('#')) { + this.store.changeList = this.store.changeList.filter((item) => item.id != sceneryId); return; } diff --git a/src/types/types.ts b/src/types/types.ts index d3e2e4a..d63d8b4 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -56,7 +56,7 @@ export interface SceneryRoutesInfo { } export interface SceneryRowItem { - id: string; + id: string | number; hash: string; name: string; abbr: string; @@ -79,7 +79,7 @@ export interface SceneryRowItem { export type ChangeItem = { [key in ChangeProp]?: any; } & { - id: string; + id: string | number; name: string; toRemove?: boolean;