Skip to content

Commit

Permalink
Merge pull request #274 from codex-team/add-user-to-history-schema
Browse files Browse the repository at this point in the history
chore(note-history): Add user to history schema
  • Loading branch information
e11sy authored Jul 31, 2024
2 parents a15f244 + 54eb101 commit 98c01e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/presentation/http/router/note.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,10 @@ describe('Note API', () => {
createdAt: history.createdAt,
content: history.content,
tools: history.tools,
user: {
name: creator.name,
photo: creator.photo,
},
},
});
}
Expand Down
15 changes: 15 additions & 0 deletions src/presentation/http/schema/History.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const HistotyRecordShema = {
'userId',
'createdAt',
'tools',
'user',
],
properties: {
id: {
Expand All @@ -29,6 +30,19 @@ export const HistotyRecordShema = {
type: 'string',
format: 'date-time',
},
user: {
type: 'object',
properties: {
name: {
description: 'name of the user',
type: 'string',
},
photo: {
description: 'photo of the user',
type: 'string',
},
},
},
content: {
description: 'content of certain version of the note',
type: 'object',
Expand Down Expand Up @@ -69,6 +83,7 @@ export const HistoryMetaSchema = {
'id',
'userId',
'createdAt',
'user',
],
properties: {
id: {
Expand Down

0 comments on commit 98c01e7

Please sign in to comment.