From e2ef6767f846d245d9b5e691dfed6b716364c7da Mon Sep 17 00:00:00 2001 From: Jan Szumotalski Date: Wed, 23 Apr 2025 11:08:05 +0200 Subject: [PATCH] fix: various menu fixes --- src/app/admin-view/admin-comm.service.ts | 3 +++ src/app/admin-view/menu-new/menu-new.component.html | 6 +++--- src/app/admin-view/menu-new/menu-new.component.ts | 4 ++++ src/app/app-view/menu/menu.component.html | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/admin-view/admin-comm.service.ts b/src/app/admin-view/admin-comm.service.ts index c2f0bd0..4f268ec 100644 --- a/src/app/admin-view/admin-comm.service.ts +++ b/src/app/admin-view/admin-comm.service.ts @@ -76,6 +76,9 @@ export class AdminCommService { range: (start: Moment, count: number) => { return this.http.post(environment.apiEndpoint+`/admin/menu/${start.toISOString()}/${count}/`, null, {withCredentials: true}) } + }, + rm: (id: string) => { + return this.http.delete(environment.apiEndpoint+`/admin/menu/${id}`, {withCredentials: true}) } } diff --git a/src/app/admin-view/menu-new/menu-new.component.html b/src/app/admin-view/menu-new/menu-new.component.html index 0986eb6..6c2f27a 100644 --- a/src/app/admin-view/menu-new/menu-new.component.html +++ b/src/app/admin-view/menu-new/menu-new.component.html @@ -20,7 +20,7 @@ {{element.day.format('DD.MM.YYYY')}}r.

{{element.day.format('dddd')}}



- +
@@ -80,7 +80,7 @@ - + @@ -108,4 +108,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/admin-view/menu-new/menu-new.component.ts b/src/app/admin-view/menu-new/menu-new.component.ts index d27d6d5..292bf82 100644 --- a/src/app/admin-view/menu-new/menu-new.component.ts +++ b/src/app/admin-view/menu-new/menu-new.component.ts @@ -124,4 +124,8 @@ export class MenuNewComponent { getStat(day: moment.Moment, m: "ob" | "kol") { this.ac.menu.stat(day, m).subscribe((s) => this.sb.open(`${s.y} / ${s.y+s.n} = ${((s.y/(s.y+s.n))*100).toFixed(2)}%`, "Zamknij", {duration: 2500})) } + + remove(id: string) { + this.ac.menu.rm(id).subscribe(this.refreshIfGood) + } } diff --git a/src/app/app-view/menu/menu.component.html b/src/app/app-view/menu/menu.component.html index afc8437..269bcda 100644 --- a/src/app/app-view/menu/menu.component.html +++ b/src/app/app-view/menu/menu.component.html @@ -14,6 +14,7 @@
  • {{i}}
  • {{i.charAt(0).toUpperCase()+i.substring(1)}}
  • +
  • {{getsn.second.charAt(0).toUpperCase()+getsn.second.substring(1)}}