feat/367 added support for name query parameter for retrieving application (#368)

* feat/367 added support for name query parameter for getting application by name

* feat/367 - Updated test case and modified retrieveAll method to make name independent of service_provider_id and account_sid

* updated query to use WHERE 1=1 to avoid whereFlag variable

* feat/367: removed empty line added accidently
This commit is contained in:
rammohan-y authored and GitHub committed 2024-12-18 08:18:48 -05:00
1 parent e080118b6a
commit 8851b3fac0
3 files changed
+31 -6

No files matched your search

+2 -1
View File
@@ -156,7 +156,8 @@ router.get('/', async(req, res) => {
try {
const service_provider_sid = req.user.hasServiceProviderAuth ? req.user.service_provider_sid : null;
const account_sid = req.user.hasAccountAuth ? req.user.account_sid : null;
const results = await Application.retrieveAll(service_provider_sid, account_sid);
const name = req.query.name;
const results = await Application.retrieveAll(service_provider_sid, account_sid, name);
res.status(200).json(results);
} catch (err) {
sysError(logger, res, err);