Selaa lähdekoodia

fix: allow edit to empty name (#3322)

martin 2 vuotta sitten
vanhempi
commit
632971a2ac

+ 1 - 1
server/src/domain/person/person.service.ts

@@ -50,7 +50,7 @@ export class PersonService {
   async update(authUser: AuthUserDto, id: string, dto: PersonUpdateDto): Promise<PersonResponseDto> {
   async update(authUser: AuthUserDto, id: string, dto: PersonUpdateDto): Promise<PersonResponseDto> {
     let person = await this.findOrFail(authUser, id);
     let person = await this.findOrFail(authUser, id);
 
 
-    if (dto.name) {
+    if (dto.name !== undefined) {
       person = await this.repository.update({ id, name: dto.name });
       person = await this.repository.update({ id, name: dto.name });
       const assets = await this.repository.getAssets(authUser.id, id);
       const assets = await this.repository.getAssets(authUser.id, id);
       const ids = assets.map((asset) => asset.id);
       const ids = assets.map((asset) => asset.id);

+ 0 - 1
web/src/lib/components/faces-page/edit-name-input.svelte

@@ -38,7 +38,6 @@
       class="gap-2 w-full bg-gray-100 dark:bg-gray-700 dark:text-white"
       class="gap-2 w-full bg-gray-100 dark:bg-gray-700 dark:text-white"
       type="text"
       type="text"
       placeholder="New name or nickname"
       placeholder="New name or nickname"
-      required
       bind:value={name}
       bind:value={name}
     />
     />
     <Button size="sm" type="submit">Done</Button>
     <Button size="sm" type="submit">Done</Button>