mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
fix: skip renaming imported repository
This commit is contained in:
@@ -367,6 +367,15 @@ const updateRepository = async (name: string, updates: { name?: string; compress
|
||||
throw new NotFoundError("Repository not found");
|
||||
}
|
||||
|
||||
if (
|
||||
updates.name !== undefined &&
|
||||
updates.name !== existing.name &&
|
||||
existing.config.backend === "local" &&
|
||||
existing.config.isExistingRepository
|
||||
) {
|
||||
throw new ConflictError("Cannot rename an imported local repository");
|
||||
}
|
||||
|
||||
let newName = existing.name;
|
||||
if (updates.name !== undefined && updates.name !== existing.name) {
|
||||
const newSlug = slugify(updates.name, { lower: true, strict: true });
|
||||
|
||||
Reference in New Issue
Block a user