From 487ba201bfbfdf300124cdb4ea53c1052d6a2283 Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Wed, 11 Oct 2023 05:36:55 +0900 Subject: [PATCH] fix announcement api --- .../server/api/endpoints/admin/announcements/list.ts | 12 ++++++------ .../api/endpoints/admin/announcements/update.ts | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index 967be98d10..f91cf647bc 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -38,6 +38,10 @@ export const meta = { optional: false, nullable: true, format: 'date-time', }, + text: { + type: 'string', + optional: false, nullable: false, + }, isActive: { type: 'boolean', optional: false, nullable: false, @@ -46,10 +50,6 @@ export const meta = { type: 'string', optional: false, nullable: false, }, - text: { - type: 'string', - optional: false, nullable: false, - }, imageUrl: { type: 'string', optional: false, nullable: true, @@ -87,7 +87,7 @@ export const meta = { optional: false, nullable: true, ref: 'UserLite', }, - readCount: { + reads: { type: 'number', optional: false, nullable: false, }, @@ -130,7 +130,7 @@ export default class extends Endpoint { // eslint- displayOrder: announcement.displayOrder, userId: announcement.userId, user: announcement.userInfo, - readCount: announcement.readCount, + reads: announcement.readCount, })); }); } diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index ce4ad04e93..aa5068c10b 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -66,6 +66,8 @@ export default class extends Endpoint { // eslint- icon: ps.icon, forExistingUsers: ps.forExistingUsers, needConfirmationToRead: ps.needConfirmationToRead, + closeDuration: ps.closeDuration, + displayOrder: ps.displayOrder, isActive: ps.isActive, }, me); });