Skip to content

Commit

Permalink
feat: Added route edit-business-profile (close #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 31, 2023
1 parent 7b1e6ab commit f741aec
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/controller/sessionController.ts
Expand Up @@ -605,3 +605,42 @@ export async function subscribePresence(req: Request, res: Response) {
});
}
}

export async function editBusinessProfile(req: Request, res: Response) {
/**
* #swagger.tags = ["Profile"]
* #swagger.description = 'Edit your bussiness profile'
#swagger.autoBody=false
#swagger.security = [{
"bearerAuth": []
}]
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$adress: 'Av. Nossa Senhora de Copacabana, 315',
$email: 'test@test.com.br',
$categories: {
$id: "133436743388217",
$localized_display_name: "Artes e entretenimento",
$not_a_biz: false,
},
$website: [
"https://www.wppconnect.io",
"https://www.teste2.com.br",
],
}
}
*/
try {
return res.status(200).json(await req.client.editBusinessProfile(req.body));
} catch (error) {
return res.status(500).json({
status: 'error',
message: 'Error on edit business profile',
error: error,
});
}
}
6 changes: 6 additions & 0 deletions src/routes/index.ts
Expand Up @@ -784,6 +784,12 @@ routes.post(
);

// Business
routes.post(
'/api/:session/edit-business-profile',
verifyToken,
statusConnection,
SessionController.editBusinessProfile
);
routes.get(
'/api/:session/get-business-profiles-products',
verifyToken,
Expand Down

0 comments on commit f741aec

Please sign in to comment.