mod
This commit is contained in:
@@ -302,16 +302,14 @@ router.get(
|
||||
* @apiParam {String} objectname name Mandatory if in conf.nationObjects then file is into nationchains/ else in /tribes/xtribe/objectname
|
||||
* @apiParam {String} primaryindex the unique id where item is store
|
||||
*
|
||||
* @apiError {json} objectNotfound the file item does not exist
|
||||
* @apiError {json} objectfiledoesnotexist the file item does not exist
|
||||
* @apiErrorExample {json}
|
||||
* HTTP/1.1 404 Not Found
|
||||
* {"status":404,"ref":"Odmdb","msg":"doesnotexist","data":{"objectname":"objectname","key":"apxid","val":"primaryindex"}}
|
||||
*
|
||||
* {status:404,ref: "Odmdb",msg: "objectfiledoesnotexist",data: { objectpath }}
|
||||
* @apiSuccess {object} indexfile content
|
||||
* @apiSuccessExample {json} Success-Response:
|
||||
* HTTP/1.1 200 OK
|
||||
* {"status":200, "ref":"Odmdb", "msg":"indexexist", "data":{"indexname","content":{itm file}}
|
||||
*
|
||||
* {status:200,ref:"Odmdb",msg:"itmfound", data:{itm:{} }} *
|
||||
*
|
||||
*/
|
||||
// indexname = objectname_key_value.json
|
||||
@@ -323,9 +321,10 @@ router.get(
|
||||
const objectpath = `../../${req.params.tribe}/objects/${req.params.objectname}/itm/${req.params.primaryindex}.json`;
|
||||
|
||||
if (fs.existsSync(objectpath)) {
|
||||
res.status(200).json({ data: fs.readJsonSync(objectpath) });
|
||||
res.status(200).json({status:200,ref:"Odmdb",msg:"itmfound", data:{itm: fs.readJsonSync(objectpath) }});
|
||||
} else {
|
||||
res.status(404).json({
|
||||
status:404,
|
||||
ref: "Odmdb",
|
||||
msg: "objectfiledoesnotexist",
|
||||
data: { objectpath },
|
||||
|
@@ -234,6 +234,8 @@ router.post( '/downloadls', checkHeaders, isAuthenticated, ( req, res ) => {
|
||||
.send( 'Forbidden access' )
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
router.post( '/upfilepond', checkHeaders, isAuthenticated, ( req, res ) => {
|
||||
console.log( 'post adminapi/tribes/uploadfilepond' );
|
||||
// Store file and return a unique id to save button
|
||||
|
Reference in New Issue
Block a user