mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 04:48:32 +03:00
rename source to sheet
This commit is contained in:
@@ -15,10 +15,10 @@ export default ({ config, controller }) => {
|
||||
res.json(controller.blueprints())
|
||||
})
|
||||
|
||||
api.get('/:source/:tab/:resource/:frag', (req, res) => {
|
||||
const { source, tab, resource, frag } = req.params
|
||||
api.get('/:sheet/:tab/:resource/:frag', (req, res) => {
|
||||
const { sheet, tab, resource, frag } = req.params
|
||||
controller
|
||||
.retrieveFrag(source, tab, resource, frag)
|
||||
.retrieveFrag(sheet, tab, resource, frag)
|
||||
.then(data => res.json(data))
|
||||
.catch(err =>
|
||||
res.status(err.status || 404)
|
||||
@@ -26,9 +26,9 @@ export default ({ config, controller }) => {
|
||||
)
|
||||
})
|
||||
|
||||
api.get('/:source/:tab/:resource', (req, res) => {
|
||||
api.get('/:sheet/:tab/:resource', (req, res) => {
|
||||
controller
|
||||
.retrieve(req.params.source, req.params.tab, req.params.resource)
|
||||
.retrieve(req.params.sheet, req.params.tab, req.params.resource)
|
||||
.then(data => res.json(data))
|
||||
.catch(err =>
|
||||
res.status(err.status || 404)
|
||||
@@ -53,12 +53,12 @@ export default ({ config, controller }) => {
|
||||
// ERROR routes. Note that it is important that these come AFTER routes
|
||||
// like /update, so that the regex does not greedily match these routes.
|
||||
|
||||
api.get('/:source', (req, res) => {
|
||||
api.get('/:sheet', (req, res) => {
|
||||
res.status(404)
|
||||
.send({ error: copy.errors.onlySource })
|
||||
.send({ error: copy.errors.onlysheet })
|
||||
})
|
||||
|
||||
api.get('/:source/:tab', (req, res) => {
|
||||
api.get('/:sheet/:tab', (req, res) => {
|
||||
res.status(404)
|
||||
.send({ error: copy.errors.onlyTab })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user