refactor: disable automatic slug regeneration on field and section name updates to ensure stable references
This commit is contained in:
@@ -108,13 +108,9 @@ export class ProfileSectionsService {
|
||||
|
||||
const data: any = { ...updateSectionDto };
|
||||
|
||||
// Resolve effective slug: explicit slug from DTO wins; otherwise regenerate from name if name changed
|
||||
let effectiveSlug: string | undefined;
|
||||
if (updateSectionDto.slug) {
|
||||
effectiveSlug = updateSectionDto.slug;
|
||||
} else if (updateSectionDto.name) {
|
||||
effectiveSlug = this.generateSlug(updateSectionDto.name);
|
||||
}
|
||||
// Slug only changes when admin explicitly sends one — renaming the section never
|
||||
// regenerates it, so field/section references stay stable.
|
||||
const effectiveSlug: string | undefined = updateSectionDto.slug;
|
||||
|
||||
if (effectiveSlug) {
|
||||
// Check if slug conflicts with another section
|
||||
|
||||
Reference in New Issue
Block a user