feat: make assignedTo field accept multiple values for all collections
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { buildJsonSchemas } from "fastify-zod";
|
||||
import mongoose from "mongoose";
|
||||
import mongoose, { Schema } from "mongoose";
|
||||
import { z } from "zod";
|
||||
import { pageQueryParams } from "../pagination";
|
||||
|
||||
@@ -27,7 +27,7 @@ const notificationSchema = new mongoose.Schema({
|
||||
createdAt: Date,
|
||||
updatedAt: Date,
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: "user",
|
||||
},
|
||||
taggedUsers: Array,
|
||||
@@ -52,12 +52,12 @@ const createNotificationInput = z.object({
|
||||
county: z.object({}).passthrough(),
|
||||
client: z.string(),
|
||||
clientData: z.object({}).passthrough(),
|
||||
assignedTo: z.string().optional(),
|
||||
assignedTo: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
const updateNotificationInput = z.object({
|
||||
status: z.string().optional(),
|
||||
assignedTo: z.string().optional(),
|
||||
assignedTo: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export type CreateNotificationInput = z.infer<typeof createNotificationInput>;
|
||||
|
||||
Reference in New Issue
Block a user