mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: handle repository id null case consistently
This commit is contained in:
parent
048c8ffc11
commit
d5137d5d3a
@ -67,8 +67,8 @@ const GiteaProviderSchema = z.object({
|
|||||||
.object({
|
.object({
|
||||||
repo: z.string().min(1, "Repo is required"),
|
repo: z.string().min(1, "Repo is required"),
|
||||||
owner: z.string().min(1, "Owner is required"),
|
owner: z.string().min(1, "Owner is required"),
|
||||||
giteaPathNamespace: z.string(),
|
giteaPathNamespace: z.string().min(1),
|
||||||
id: z.number().nullable(),
|
id: z.number().nullable().optional(),
|
||||||
})
|
})
|
||||||
.required(),
|
.required(),
|
||||||
branch: z.string().min(1, "Branch is required"),
|
branch: z.string().min(1, "Branch is required"),
|
||||||
@ -129,7 +129,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
{
|
{
|
||||||
owner: repository?.owner,
|
owner: repository?.owner,
|
||||||
repositoryName: repository?.repo,
|
repositoryName: repository?.repo,
|
||||||
id: repository?.id || 0,
|
id: repository?.id ?? 0, // Use nullish coalescing to provide 0 as a fallback
|
||||||
giteaId: giteaId,
|
giteaId: giteaId,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -145,7 +145,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
repo: data.giteaRepository || "",
|
repo: data.giteaRepository || "",
|
||||||
owner: data.giteaOwner || "",
|
owner: data.giteaOwner || "",
|
||||||
giteaPathNamespace: data.giteaPathNamespace || "",
|
giteaPathNamespace: data.giteaPathNamespace || "",
|
||||||
id: data.giteaProjectId,
|
id: data.giteaProjectId || null, // Handle null case explicitly
|
||||||
},
|
},
|
||||||
buildPath: data.giteaBuildPath || "/",
|
buildPath: data.giteaBuildPath || "/",
|
||||||
giteaId: data.giteaId || "",
|
giteaId: data.giteaId || "",
|
||||||
@ -162,7 +162,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
giteaBuildPath: data.buildPath,
|
giteaBuildPath: data.buildPath,
|
||||||
giteaId: data.giteaId,
|
giteaId: data.giteaId,
|
||||||
applicationId,
|
applicationId,
|
||||||
giteaProjectId: data.repository.id,
|
giteaProjectId: data.repository.id || null, // Handle null case explicitly
|
||||||
giteaPathNamespace: data.repository.giteaPathNamespace,
|
giteaPathNamespace: data.repository.giteaPathNamespace,
|
||||||
watchPaths: data.watchPaths,
|
watchPaths: data.watchPaths,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user