summaryrefslogtreecommitdiff
path: root/lib/vendor-document-list/plant/shi-buyer-system-api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vendor-document-list/plant/shi-buyer-system-api.ts')
-rw-r--r--lib/vendor-document-list/plant/shi-buyer-system-api.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/vendor-document-list/plant/shi-buyer-system-api.ts b/lib/vendor-document-list/plant/shi-buyer-system-api.ts
index 1f15efa6..582490af 100644
--- a/lib/vendor-document-list/plant/shi-buyer-system-api.ts
+++ b/lib/vendor-document-list/plant/shi-buyer-system-api.ts
@@ -162,10 +162,9 @@ export class ShiBuyerSystemAPI {
vendorName: sql<string>`(SELECT vendor_name FROM vendors WHERE id = ${stageDocuments.vendorId})`,
stages: sql<any[]>`
COALESCE(
- (SELECT json_agg(row_to_json(s.*))
+ (SELECT json_agg(row_to_json(s.*) ORDER BY s.stage_order)
FROM stage_issue_stages s
- WHERE s.document_id = ${stageDocuments.id}
- ORDER BY s.stage_order),
+ WHERE s.document_id = ${stageDocuments.id}),
'[]'::json
)
`
@@ -178,7 +177,8 @@ export class ShiBuyerSystemAPI {
ne(stageDocuments.buyerSystemStatus, "승인(DC)")
)
)
-
+
+
return result
}