Skip to content

Commit

Permalink
feat: Merge the result of the creation with the privacy flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Szuchet committed Jun 7, 2023
1 parent eaf2cb8 commit b8f689a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ports/lists/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function createListsComponent(components: Pick<AppComponents, 'pg' | 'sna
await client.query(insertAccessQuery(id, Permission.VIEW, GRANTED_TO_ALL))
}

return insertedList
return { ...insertedList, is_private: isPrivate }
},
(error: unknown) => {
validateDuplicatedListName(name, error)
Expand Down
6 changes: 3 additions & 3 deletions test/unit/lists-component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ describe('when creating a new list', () => {
description: null,
created_at: new Date(),
updated_at: new Date(),
is_private: false
is_private: true
}

// Create List Query
Expand Down Expand Up @@ -612,7 +612,7 @@ describe('when creating a new list', () => {
})

it('should resolve with the new list', () => {
expect(result).toEqual(dbList)
expect(result).toEqual({ ...dbList, is_private: true })
})
})

Expand Down Expand Up @@ -643,7 +643,7 @@ describe('when creating a new list', () => {
})

it('should resolve with the new list', () => {
expect(result).toEqual(dbList)
expect(result).toEqual({ ...dbList, is_private: false })
})
})
})
Expand Down

0 comments on commit b8f689a

Please sign in to comment.