Skip to content

Commit

Permalink
Sort correct field in workflow-instances
Browse files Browse the repository at this point in the history
  • Loading branch information
FyreByrd committed Feb 4, 2025
1 parent 9d48530 commit ff6034c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,17 @@ export const actions: Actions = {

const instances = await prisma.workflowInstances.findMany({
orderBy:
form.data.sort?.field === 'product'
? { ProductId: form.data.sort.direction }
: form.data.sort?.field === 'organization'
form.data.sort?.field === 'organization'
? { Product: { Project: { Organization: { Name: form.data.sort.direction } } } }
: form.data.sort?.field === 'project'
? { Product: { Project: { Name: form.data.sort.direction } } }
: form.data.sort?.field === 'definition'
? { Product: { ProductDefinition: { Name: form.data.sort.direction } } }
: form.data.sort?.field === 'state'
? { State: form.data.sort.direction }
: form.data.sort?.field === 'date'
? { DateUpdated: form.data.sort.direction }
: undefined,
? { Product: { Project: { Name: form.data.sort.direction } } }
: form.data.sort?.field === 'definition'
? { Product: { ProductDefinition: { Name: form.data.sort.direction } } }
: form.data.sort?.field === 'state'
? { State: form.data.sort.direction }
: form.data.sort?.field === 'date'
? { DateUpdated: form.data.sort.direction }
: undefined,
where: where,
select: {
State: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
compare: () => 0
},
{
id: 'product',
id: 'definition',
header: m.tasks_product(),
compare: () => 0
},
Expand Down

0 comments on commit ff6034c

Please sign in to comment.