From 73dd8c25b7f782a882682039a3cba94526af9906 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 27 Jul 2024 21:29:31 +0800 Subject: [PATCH] feat: add none in feed channel --- src/client/components/feed/FeedChannelEditForm.tsx | 5 +++-- .../20240727132608_add_none_notify_frequency/migration.sql | 2 ++ src/server/prisma/schema.prisma | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/server/prisma/migrations/20240727132608_add_none_notify_frequency/migration.sql diff --git a/src/client/components/feed/FeedChannelEditForm.tsx b/src/client/components/feed/FeedChannelEditForm.tsx index 7ce6060..e7312b0 100644 --- a/src/client/components/feed/FeedChannelEditForm.tsx +++ b/src/client/components/feed/FeedChannelEditForm.tsx @@ -28,7 +28,7 @@ import { NotificationPicker } from '../notification/NotificationPicker'; const addFormSchema = z.object({ name: z.string(), notificationIds: z.array(z.string()).default([]), - notifyFrequency: z.enum(['event', 'day', 'week', 'month']), + notifyFrequency: z.enum(['none', 'event', 'day', 'week', 'month']), }); export type FeedChannelEditFormValues = z.infer; @@ -46,7 +46,7 @@ export const FeedChannelEditForm: React.FC = defaultValues: props.defaultValues ?? { name: 'New Channel', notificationIds: [], - notifyFrequency: 'day', + notifyFrequency: 'none', }, }); @@ -116,6 +116,7 @@ export const FeedChannelEditForm: React.FC = + {t('None')} {t('Every Event')} diff --git a/src/server/prisma/migrations/20240727132608_add_none_notify_frequency/migration.sql b/src/server/prisma/migrations/20240727132608_add_none_notify_frequency/migration.sql new file mode 100644 index 0000000..b7f0c82 --- /dev/null +++ b/src/server/prisma/migrations/20240727132608_add_none_notify_frequency/migration.sql @@ -0,0 +1,2 @@ +-- AlterEnum +ALTER TYPE "FeedChannelNotifyFrequency" ADD VALUE 'none'; diff --git a/src/server/prisma/schema.prisma b/src/server/prisma/schema.prisma index 207162f..c9ef1b5 100644 --- a/src/server/prisma/schema.prisma +++ b/src/server/prisma/schema.prisma @@ -447,6 +447,7 @@ model SurveyResult { } enum FeedChannelNotifyFrequency { + none event day week