@zyacreatives/shared 2.0.72 → 2.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -91,10 +91,10 @@ export declare const CreateProjectInputSchema: z.ZodObject<{
|
|
|
91
91
|
title: z.ZodString;
|
|
92
92
|
description: z.ZodOptional<z.ZodString>;
|
|
93
93
|
overview: z.ZodOptional<z.ZodString>;
|
|
94
|
-
url: z.ZodString
|
|
94
|
+
url: z.ZodOptional<z.ZodString>;
|
|
95
95
|
imagePlaceholderUrl: z.ZodURL;
|
|
96
96
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
97
|
-
startDate: z.ZodCoercedDate<unknown
|
|
97
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
98
98
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
99
99
|
projectCreatorType: z.ZodDefault<z.ZodEnum<{
|
|
100
100
|
readonly CREATIVE: "CREATIVE";
|
package/dist/schemas/project.js
CHANGED
|
@@ -140,10 +140,10 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
|
140
140
|
title: zod_openapi_1.z.string().min(1).max(100),
|
|
141
141
|
description: zod_openapi_1.z.string().max(1000).optional(),
|
|
142
142
|
overview: zod_openapi_1.z.string().optional(),
|
|
143
|
-
url: zod_openapi_1.z.string(),
|
|
143
|
+
url: zod_openapi_1.z.string().optional(),
|
|
144
144
|
imagePlaceholderUrl: zod_openapi_1.z.url(),
|
|
145
145
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
|
|
146
|
-
startDate: zod_openapi_1.z.coerce.date(),
|
|
146
|
+
startDate: zod_openapi_1.z.coerce.date().optional(),
|
|
147
147
|
endDate: zod_openapi_1.z.coerce.date().optional(),
|
|
148
148
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
|
|
149
149
|
clientId: zod_openapi_1.z.string().optional(),
|
|
@@ -157,6 +157,8 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
|
157
157
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
158
158
|
const today = new Date();
|
|
159
159
|
today.setHours(0, 0, 0, 0);
|
|
160
|
+
if (!startDate)
|
|
161
|
+
return;
|
|
160
162
|
if (startDate > today)
|
|
161
163
|
ctx.addIssue({
|
|
162
164
|
path: ["startDate"],
|
package/package.json
CHANGED
package/src/schemas/project.ts
CHANGED
|
@@ -146,10 +146,10 @@ export const CreateProjectInputSchema = z
|
|
|
146
146
|
title: z.string().min(1).max(100),
|
|
147
147
|
description: z.string().max(1000).optional(),
|
|
148
148
|
overview: z.string().optional(),
|
|
149
|
-
url: z.string(),
|
|
149
|
+
url: z.string().optional(),
|
|
150
150
|
imagePlaceholderUrl: z.url(),
|
|
151
151
|
tags: z.array(z.string()).default([]),
|
|
152
|
-
startDate: z.coerce.date(),
|
|
152
|
+
startDate: z.coerce.date().optional(),
|
|
153
153
|
endDate: z.coerce.date().optional(),
|
|
154
154
|
projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
|
|
155
155
|
clientId: z.string().optional(),
|
|
@@ -165,6 +165,7 @@ export const CreateProjectInputSchema = z
|
|
|
165
165
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
166
166
|
const today = new Date();
|
|
167
167
|
today.setHours(0, 0, 0, 0);
|
|
168
|
+
if (!startDate) return;
|
|
168
169
|
if (startDate > today)
|
|
169
170
|
ctx.addIssue({
|
|
170
171
|
path: ["startDate"],
|