feat: add target organization to Add Repository dialog (#202)

* feat: add target organization field to Add Repository dialog

Allow users to specify a destination Gitea organization when adding a
single repository, instead of relying solely on the default mirror
strategy. The field is optional — when left empty, the existing strategy
logic applies as before.

Closes #200

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add screenshot of target organization field in Add Repository dialog

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ARUNAVO RAY
2026-03-01 07:55:27 +05:30
committed by GitHub
parent 2e00a610cb
commit be46cfdffa
5 changed files with 37 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ export const POST: APIRoute = async ({ request, locals }) => {
const userId = authResult.userId;
const body: AddRepositoriesApiRequest = await request.json();
const { owner, repo, force = false } = body;
const { owner, repo, force = false, destinationOrg } = body;
if (!owner || !repo) {
return new Response(
@@ -122,7 +122,7 @@ export const POST: APIRoute = async ({ request, locals }) => {
lastMirrored: existingRepo?.lastMirrored ?? null,
errorMessage: existingRepo?.errorMessage ?? null,
mirroredLocation: existingRepo?.mirroredLocation ?? "",
destinationOrg: existingRepo?.destinationOrg ?? null,
destinationOrg: destinationOrg?.trim() || existingRepo?.destinationOrg || null,
updatedAt: repoData.updated_at
? new Date(repoData.updated_at)
: new Date(),