implemented region search by name

This commit is contained in:
Mikayla Dobson
2022-09-27 16:51:16 -05:00
parent d020fa8af4
commit efa74d1c16
11 changed files with 38 additions and 220 deletions

View File

@@ -23,6 +23,16 @@ module.exports = class RegionsService {
}
}
async getOneByName(name) {
try {
const result = await RegionInstance.getOneByName(name);
if (!result) throw createError(404, "No region entries found.");
return result;
} catch(e) {
throw new Error(e);
}
}
async create(data) {
try {
const result = await RegionInstance(data);