Skip to content

Commit

Permalink
fix: middleware bug during home org resync
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Nov 16, 2023
1 parent 5ea7c75 commit aa610a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ app.use(async function (req, res, next) {
const homeOrg = await Organization.getHomeOrg();

if (homeOrg) {
if (req.method !== 'GET' && !homeOrg.synced) {
if (!['GET', 'DELETE'].includes(req.method) && !homeOrg.synced) {
res.status(400).json({
message:
'Your organization data is still resyncing, please try again after it completes',
success: false,
});
return;
} else if (homeOrg?.synced) {
res.setHeader(headerKeys.HOME_ORGANIZATION_SYNCED, true);
} else {
Expand Down

0 comments on commit aa610a5

Please sign in to comment.