mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
feat: add blob variant to SotrageChannelFormSchema
This commit is contained in:
@@ -9,6 +9,7 @@ import {WebhookChannelConfigSchema} from "@/features/channel/notifications/webho
|
|||||||
import {NextcloudChannelConfigSchema} from "@/features/channel/notifications/nextcloud.schema";
|
import {NextcloudChannelConfigSchema} from "@/features/channel/notifications/nextcloud.schema";
|
||||||
import {S3ChannelConfigSchema} from "@/features/channel/storages/s3.schema";
|
import {S3ChannelConfigSchema} from "@/features/channel/storages/s3.schema";
|
||||||
import {GoogleDriveChannelConfigSchema} from "@/features/channel/storages/google-drive/google-drive.schema";
|
import {GoogleDriveChannelConfigSchema} from "@/features/channel/storages/google-drive/google-drive.schema";
|
||||||
|
import { BlobChannelConfigSchema } from "@/features/channel/storages/Blob.schema";
|
||||||
import {LocalChannelConfigSchema} from "@/features/channel/storages/local.schema";
|
import {LocalChannelConfigSchema} from "@/features/channel/storages/local.schema";
|
||||||
import {TeamsChannelConfigSchema} from "@/features/channel/notifications/teams.schema";
|
import {TeamsChannelConfigSchema} from "@/features/channel/notifications/teams.schema";
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ const BaseChannelFormSchema = z.object({
|
|||||||
name: z
|
name: z
|
||||||
.string()
|
.string()
|
||||||
.min(5, "Name must be at least 5 characters long")
|
.min(5, "Name must be at least 5 characters long")
|
||||||
.max(40, "Name must be at most 40 characters long"),
|
.max(40, "Name e at most 40 characters long"),
|
||||||
enabled: z.boolean().default(true),
|
enabled: z.boolean().default(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -69,6 +70,10 @@ export const StorageChannelFormSchema = z.discriminatedUnion("provider", [
|
|||||||
provider: z.literal("google-drive"),
|
provider: z.literal("google-drive"),
|
||||||
config: GoogleDriveChannelConfigSchema,
|
config: GoogleDriveChannelConfigSchema,
|
||||||
}),
|
}),
|
||||||
|
BaseChannelFormSchema.extend({
|
||||||
|
provider: z.literal("blob"),
|
||||||
|
config: BlobChannelConfigSchema,
|
||||||
|
}),
|
||||||
BaseChannelFormSchema.extend({
|
BaseChannelFormSchema.extend({
|
||||||
provider: z.literal("local"),
|
provider: z.literal("local"),
|
||||||
config: LocalChannelConfigSchema
|
config: LocalChannelConfigSchema
|
||||||
|
|||||||
Reference in New Issue
Block a user