fix __dirapi by conf.dirapi
This commit is contained in:
@@ -114,7 +114,7 @@ router.post("/", checkHeaders, isAuthenticated, (req, res) => {
|
||||
* - check that alias does not already exist (if yes then verifiedsigne would be false)
|
||||
* Need to wait next block chain to be sure that alias is register in the blokchain
|
||||
*/
|
||||
console.log("pass ici", req.body);
|
||||
//console.log("pass ici", req.body);
|
||||
const feedback = { alias: req.body.alias, publickey: req.body.publickey };
|
||||
const newpagan = Pagans.create(req.body.alias, req.body.publickey);
|
||||
if (newpagan.status == 200) {
|
||||
@@ -136,20 +136,29 @@ router.post("/", checkHeaders, isAuthenticated, (req, res) => {
|
||||
if (req.app.locals.tribeids.includes(req.body.trustedtribe)) {
|
||||
delete feedback.withemail;
|
||||
const persondata = { recovery: feedback };
|
||||
res.send(
|
||||
const persoup = Pagans.personupdate(req.body.alias, req.body.trustedtribe, persondata)
|
||||
res.status(persoup.status).json(persoup)
|
||||
/*res.send(
|
||||
Pagans.personupdate(req.body.alias, req.body.trustedtribe, persondata)
|
||||
);
|
||||
);*/
|
||||
} else {
|
||||
res.send({
|
||||
status: 404,
|
||||
res.status(404).json({
|
||||
status:404,
|
||||
ref: "Pagans",
|
||||
msg: "tribedoesnotexist",
|
||||
data: { tribe: req.body.trustedtribe },
|
||||
});
|
||||
/*res.send({
|
||||
status: 404,
|
||||
ref: "Pagans",
|
||||
msg: "tribedoesnotexist",
|
||||
data: { tribe: req.body.trustedtribe },
|
||||
});*/
|
||||
}
|
||||
} else {
|
||||
newpagan.data = feedback;
|
||||
res.send(newpagan);
|
||||
res.status(newpagan.status).json(newpagan);
|
||||
//res.send(newpagan);
|
||||
}
|
||||
} else {
|
||||
//error to create pagan
|
||||
@@ -166,10 +175,9 @@ router.put("/person", checkHeaders, isAuthenticated, (req, res) => {
|
||||
* add/update a person = alias + tribe with specific accessright and specific schema link to tribe
|
||||
* @todo add tribe/schema/person.json
|
||||
*/
|
||||
console.log(req.body);
|
||||
res.send(
|
||||
Pagans.personupdate(req.body.alias, req.session.header.xtribe, req.body)
|
||||
);
|
||||
//console.log(req.body);
|
||||
const persoup = Pagans.personupdate(req.body.alias, req.session.header.xtribe, req.body);
|
||||
res.status(persoup.status).json(persoup);
|
||||
});
|
||||
router.delete("/:alias", checkHeaders, isAuthenticated, (req, res) => {
|
||||
/**
|
||||
|
@@ -22,8 +22,10 @@ router.get("/changeowner/:alias",checkHeaders, isAuthenticated, (req, res) => {
|
||||
* @apiError (404) {object} {ref:"towns",msg:"aliasnotallow",data: { alias} }
|
||||
*
|
||||
**/
|
||||
res.send(Towns.changeowner(req.params.alias, req.session.header.alias));
|
||||
res.send(Towns.changeowner(req.params.alias, req.session.header.xalias));
|
||||
});
|
||||
|
||||
//=======================================================================================
|
||||
router.get("/person/:alias", checkHeaders, isAuthenticated, (req, res) => {
|
||||
/**
|
||||
* @api {get} /pagans/person:alias
|
||||
|
Reference in New Issue
Block a user