mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 10:06:17 +08:00
fix(server): add mode property on mention doc input (#10853)
This commit is contained in:
@@ -9,6 +9,7 @@ import { z } from 'zod';
|
||||
|
||||
import { PaginationInput } from '../base';
|
||||
import { BaseModel } from './base';
|
||||
import { DocMode } from './common';
|
||||
|
||||
export { NotificationLevel, NotificationType };
|
||||
export type { Notification };
|
||||
@@ -30,11 +31,15 @@ export const MentionDocSchema = z.object({
|
||||
id: IdSchema,
|
||||
// Allow empty string, will display as `Untitled` at frontend
|
||||
title: z.string().trim().max(255),
|
||||
mode: z.nativeEnum(DocMode),
|
||||
// blockId or elementId is required at least one
|
||||
blockId: IdSchema.optional(),
|
||||
elementId: IdSchema.optional(),
|
||||
});
|
||||
|
||||
export type MentionDoc = z.infer<typeof MentionDocSchema>;
|
||||
export type MentionDocCreate = z.input<typeof MentionDocSchema>;
|
||||
|
||||
const MentionNotificationBodySchema = z.object({
|
||||
workspaceId: IdSchema,
|
||||
createdByUserId: IdSchema,
|
||||
|
||||
Reference in New Issue
Block a user