Skip to content

Commit

Permalink
fix: sync API clarify response, remove operation name in UI (#3247)
Browse files Browse the repository at this point in the history
## Changes

Various small changes

- Return an actual JSON for /sync/start,pause,trigger 
- Remove the operation name in the log UI
  • Loading branch information
bodinsamuel authored Jan 6, 2025
1 parent 80ad361 commit 703e5b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
29 changes: 28 additions & 1 deletion docs-v2/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,11 +1141,20 @@ paths:
type: string
full_resync:
type: boolean
description: Clear the records and reset the "lastSyncDate" associated with the sync before triggering a new sync job.
description: Reset the "lastSyncDate" associated with the sync before triggering a new sync job.

responses:
'200':
description: Successfully triggered the sync
content:
application/json:
schema:
type: object
required:
- success
properties:
success:
type: boolean
'400':
description: Invalid request
content:
Expand Down Expand Up @@ -1182,6 +1191,15 @@ paths:
responses:
'200':
description: Successfully started the sync
content:
application/json:
schema:
type: object
required:
- success
properties:
success:
type: boolean
'400':
description: Invalid request
content:
Expand Down Expand Up @@ -1217,6 +1235,15 @@ paths:
responses:
'200':
description: Successfully paused the sync
content:
application/json:
schema:
type: object
required:
- success
properties:
success:
type: boolean
'400':
description: Invalid request
content:
Expand Down
6 changes: 3 additions & 3 deletions packages/server/lib/controllers/sync.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class SyncController {
return;
}

res.sendStatus(200);
res.status(200).send({ success: true });
} catch (err) {
next(err);
}
Expand Down Expand Up @@ -422,7 +422,7 @@ class SyncController {
initiator: 'API call'
});

res.sendStatus(200);
res.status(200).send({ success: true });
} catch (err) {
next(err);
}
Expand Down Expand Up @@ -464,7 +464,7 @@ class SyncController {
initiator: 'API call'
});

res.sendStatus(200);
res.status(200).send({ success: true });
} catch (err) {
next(err);
}
Expand Down
8 changes: 1 addition & 7 deletions packages/webapp/src/pages/Logs/components/OperationTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ export const OperationTag: React.FC<{ message: string; operation: Exclude<Search
</div>
</Tooltip.TooltipTrigger>
<Tooltip.TooltipContent align="start">
<p>
{message}{' '}
<code className="text-xs">
({operation.type}
{'action' in operation && <>:{operation.action}</>})
</code>
</p>
<p>{message}</p>
</Tooltip.TooltipContent>
</Tooltip.Tooltip>
);
Expand Down

0 comments on commit 703e5b0

Please sign in to comment.