mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Add ws id and doc name params to POST /docs (#655)
This commit is contained in:
@@ -1807,6 +1807,9 @@ export class HomeDBManager extends EventEmitter {
|
||||
return queryResult;
|
||||
}
|
||||
const workspace: Workspace = queryResult.data;
|
||||
if (workspace.removedAt) {
|
||||
throw new ApiError('Cannot add document to a deleted workspace', 400);
|
||||
}
|
||||
await this._checkRoomForAnotherDoc(workspace, manager);
|
||||
// Create a new document.
|
||||
const doc = new Document();
|
||||
|
||||
@@ -260,7 +260,7 @@ export class Housekeeper {
|
||||
// which worker group the document is assigned a worker from.
|
||||
app.post('/api/housekeeping/docs/:docId/assign', this._withSupport(async (req, docId, headers) => {
|
||||
const url = new URL(await this._server.getHomeUrlByDocId(docId, `/api/docs/${docId}/assign`));
|
||||
const group = optStringParam(req.query.group);
|
||||
const group = optStringParam(req.query.group, 'group');
|
||||
if (group !== undefined) { url.searchParams.set('group', group); }
|
||||
return fetch(url.toString(), {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user