mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Sort labels by position order
This commit is contained in:
parent
5e8508e025
commit
31d8f72840
3 changed files with 5 additions and 2 deletions
|
|
@ -28,4 +28,7 @@ export class Label {
|
|||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date
|
||||
|
||||
@Column('integer', { default: 0 })
|
||||
position!: number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const labelsResolver = authorized<LabelsSuccess, LabelsError>(
|
|||
relations: ['labels'],
|
||||
order: {
|
||||
labels: {
|
||||
createdAt: 'DESC',
|
||||
position: 'ASC',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ describe('Labels API', () => {
|
|||
user: { id: user.id },
|
||||
})
|
||||
expect(res.body.data.labels.labels).to.eql(
|
||||
labels.reverse().map((label) => ({
|
||||
labels.map((label) => ({
|
||||
id: label.id,
|
||||
name: label.name,
|
||||
color: label.color,
|
||||
|
|
|
|||
Loading…
Reference in a new issue