mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) make document assignment endpoint available via /housekeeping api
Summary: The /assign endpoint checks if a document is on the desired worker and moves it if not. This is never done under regular operation, but is useful when quarantining a misbehaving document. The endpoint was failing to operate correctly if the requester did not have access to the document. This diff makes the endpoint accessible through a /housekeeping route, using the same pattern as the /force-reload endpoint. Test Plan: added test Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3109
This commit is contained in:
@@ -161,6 +161,16 @@ export class Housekeeper {
|
||||
headers,
|
||||
});
|
||||
}));
|
||||
|
||||
// Move a document to its assigned worker. Can be useful during administrative
|
||||
// actions.
|
||||
app.post('/api/housekeeping/docs/:docId/assign', this._withSupport(async (docId, headers) => {
|
||||
const url = await this._server.getHomeUrlByDocId(docId, `/api/docs/${docId}/assign`);
|
||||
return fetch(url, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user