Skip to content

Commit

Permalink
feat(api): set person color (immich-app#15937)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 authored Feb 7, 2025
1 parent 2e5007a commit 23014c2
Show file tree
Hide file tree
Showing 18 changed files with 182 additions and 21 deletions.
19 changes: 19 additions & 0 deletions e2e/src/api/specs/person.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ describe('/people', () => {
.send({
name: 'New Person',
birthDate: '1990-01-01',
color: '#333',
});
expect(status).toBe(201);
expect(body).toMatchObject({
Expand Down Expand Up @@ -273,6 +274,24 @@ describe('/people', () => {
expect(body).toMatchObject({ birthDate: null });
});

it('should set a color', async () => {
const { status, body } = await request(app)
.put(`/people/${visiblePerson.id}`)
.set('Authorization', `Bearer ${admin.accessToken}`)
.send({ color: '#555' });
expect(status).toBe(200);
expect(body).toMatchObject({ color: '#555' });
});

it('should clear a color', async () => {
const { status, body } = await request(app)
.put(`/people/${visiblePerson.id}`)
.set('Authorization', `Bearer ${admin.accessToken}`)
.send({ color: null });
expect(status).toBe(200);
expect(body.color).toBeUndefined();
});

it('should mark a person as favorite', async () => {
const person = await utils.createPerson(admin.accessToken, {
name: 'visible_person',
Expand Down
13 changes: 12 additions & 1 deletion mobile/openapi/lib/model/people_update_item.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion mobile/openapi/lib/model/person_create_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion mobile/openapi/lib/model/person_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion mobile/openapi/lib/model/person_update_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion mobile/openapi/lib/model/person_with_faces_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 23014c2

Please sign in to comment.