Skip to content

Commit 98c01e7

Browse files
authored
Merge pull request #274 from codex-team/add-user-to-history-schema
chore(note-history): Add user to history schema
2 parents a15f244 + 54eb101 commit 98c01e7

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/presentation/http/router/note.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,10 @@ describe('Note API', () => {
20742074
createdAt: history.createdAt,
20752075
content: history.content,
20762076
tools: history.tools,
2077+
user: {
2078+
name: creator.name,
2079+
photo: creator.photo,
2080+
},
20772081
},
20782082
});
20792083
}

src/presentation/http/schema/History.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const HistotyRecordShema = {
1010
'userId',
1111
'createdAt',
1212
'tools',
13+
'user',
1314
],
1415
properties: {
1516
id: {
@@ -29,6 +30,19 @@ export const HistotyRecordShema = {
2930
type: 'string',
3031
format: 'date-time',
3132
},
33+
user: {
34+
type: 'object',
35+
properties: {
36+
name: {
37+
description: 'name of the user',
38+
type: 'string',
39+
},
40+
photo: {
41+
description: 'photo of the user',
42+
type: 'string',
43+
},
44+
},
45+
},
3246
content: {
3347
description: 'content of certain version of the note',
3448
type: 'object',
@@ -69,6 +83,7 @@ export const HistoryMetaSchema = {
6983
'id',
7084
'userId',
7185
'createdAt',
86+
'user',
7287
],
7388
properties: {
7489
id: {

0 commit comments

Comments
 (0)