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 { files } from "../file/file.schema";
|
||||
import { pageQueryParams } from "../pagination";
|
||||
@@ -51,7 +51,7 @@ const rtsSchema = new mongoose.Schema({
|
||||
ref: "user",
|
||||
},
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: "user",
|
||||
},
|
||||
taggedUsers: Array,
|
||||
@@ -85,7 +85,7 @@ const rtsCreateInput = z.object({
|
||||
currentStage: z.number(),
|
||||
})
|
||||
.optional(),
|
||||
assignedTo: z.string().optional(),
|
||||
assignedTo: z.array(z.string()).optional(),
|
||||
status: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -109,7 +109,7 @@ const rtsUpdateInput = z.object({
|
||||
currentStage: z.number(),
|
||||
})
|
||||
.optional(),
|
||||
assignedTo: z.string().optional(),
|
||||
assignedTo: z.array(z.string()).optional(),
|
||||
status: z.string().optional(),
|
||||
fileValidationStatus: z.string().optional(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user