mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-22 11:58:46 +00:00
refactor(schema): update API schemas for libsql and mount
- Replaced `createSchema.pick` with `z.object` for `apiFindOneLibsql` and `apiFindMountByApplicationId` to enforce stricter validation. - Ensured `libsqlId`, `serviceType`, and `serviceId` are required strings with minimum length constraints.
This commit is contained in:
@@ -179,11 +179,9 @@ export const apiCreateLibsql = createSchema
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const apiFindOneLibsql = createSchema
|
export const apiFindOneLibsql = z.object({
|
||||||
.pick({
|
libsqlId: z.string().min(1),
|
||||||
libsqlId: true,
|
});
|
||||||
})
|
|
||||||
.required();
|
|
||||||
|
|
||||||
export const apiChangeLibsqlStatus = createSchema
|
export const apiChangeLibsqlStatus = createSchema
|
||||||
.pick({
|
.pick({
|
||||||
|
|||||||
@@ -149,14 +149,10 @@ export const apiRemoveMount = createSchema
|
|||||||
// })
|
// })
|
||||||
.required();
|
.required();
|
||||||
|
|
||||||
export const apiFindMountByApplicationId = createSchema
|
export const apiFindMountByApplicationId = z.object({
|
||||||
.pick({
|
serviceType: z.string().min(1).transform((val) => val as ServiceType),
|
||||||
serviceType: true,
|
serviceId: z.string().min(1),
|
||||||
})
|
});
|
||||||
.required()
|
|
||||||
.extend({
|
|
||||||
serviceId: z.string().min(1),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const apiUpdateMount = createSchema.partial().extend({
|
export const apiUpdateMount = createSchema.partial().extend({
|
||||||
mountId: z.string().min(1),
|
mountId: z.string().min(1),
|
||||||
|
|||||||
Reference in New Issue
Block a user