feat: add none in feed channel

This commit is contained in:
moonrailgun 2024-07-27 21:29:31 +08:00
parent e4eee420ea
commit 73dd8c25b7
3 changed files with 6 additions and 2 deletions

View File

@ -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<typeof addFormSchema>;
@ -46,7 +46,7 @@ export const FeedChannelEditForm: React.FC<FeedChannelEditFormProps> =
defaultValues: props.defaultValues ?? {
name: 'New Channel',
notificationIds: [],
notifyFrequency: 'day',
notifyFrequency: 'none',
},
});
@ -116,6 +116,7 @@ export const FeedChannelEditForm: React.FC<FeedChannelEditFormProps> =
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">{t('None')}</SelectItem>
<SelectItem value="event">
{t('Every Event')}
</SelectItem>

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "FeedChannelNotifyFrequency" ADD VALUE 'none';

View File

@ -447,6 +447,7 @@ model SurveyResult {
}
enum FeedChannelNotifyFrequency {
none
event
day
week