feat(t237): import freight orders synchronously
This commit is contained in:
@@ -106,7 +106,15 @@ func (h *adminHandlers) createFreightSync(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
ctx.Header("Cache-Control", "no-store")
|
||||
ctx.JSON(http.StatusAccepted, gin.H{
|
||||
status := http.StatusAccepted
|
||||
if request.Mode == domain.FreightSyncOrderNumber {
|
||||
status = http.StatusCreated
|
||||
if result.Replayed {
|
||||
status = http.StatusOK
|
||||
}
|
||||
ctx.Header("Location", "/api/v1/freight-orders")
|
||||
}
|
||||
ctx.JSON(status, gin.H{
|
||||
"sync": freightSyncResponse(result.Run),
|
||||
"replayed": result.Replayed,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user