feat(note-metadata): replace primaryAlias with primaryAddress

The primary address is never null.
If no alias is set, the id is returned.

To still easily get the primary alias, the complete Alias DTOs
are now included in the metadata.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-02-14 15:26:29 +01:00
parent 64b16c831e
commit 342efcd7b7
9 changed files with 50 additions and 21 deletions

View file

@ -276,8 +276,8 @@ describe('Notes', () => {
.get('/api/v2/notes/test5/metadata')
.expect(200);
expect(typeof metadata.body.id).toEqual('string');
expect(metadata.body.aliases).toEqual(['test5']);
expect(metadata.body.primaryAlias).toEqual('test5');
expect(metadata.body.aliases[0].name).toEqual('test5');
expect(metadata.body.primaryAddress).toEqual('test5');
expect(metadata.body.title).toEqual('');
expect(metadata.body.description).toEqual('');
expect(typeof metadata.body.createdAt).toEqual('string');