-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new dataset (entity list) or property via the API (#1105)
* starter code to publish new dataset from api * dataset property via api * More tests * renamed dataset query helper functions * Log new dataset and properties from api in audit log * add dataset.create verb * code review: timestamps, validation, responses, bugs * Part of docs: new dataset endpoint * Removed console log * small fixes * Updated docs
- Loading branch information
Showing
5 changed files
with
582 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/model/migrations/20240312-01-add-dataset-create-verb.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 ODK Central Developers | ||
// See the NOTICE file at the top-level directory of this distribution and at | ||
// https://github.com/getodk/central-backend/blob/master/NOTICE. | ||
// This file is part of ODK Central. It is subject to the license terms in | ||
// the LICENSE file found in the top-level directory of this distribution and at | ||
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
// including this file, may be copied, modified, propagated, or distributed | ||
// except according to the terms contained in the LICENSE file. | ||
|
||
const up = (db) => db.raw(` | ||
UPDATE roles | ||
SET verbs = verbs || '["dataset.create"]'::jsonb | ||
WHERE system in ('admin', 'manager') | ||
`); | ||
|
||
const down = (db) => db.raw(` | ||
UPDATE roles | ||
SET verbs = (verbs - 'dataset.create') | ||
WHERE system in ('admin', 'manager') | ||
`); | ||
|
||
module.exports = { up, down }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.