refactor: helper function manual throw

This change is to prevent swagger to infer empty type from return type
This commit is contained in:
Methapon Metanipat 2024-09-11 14:38:26 +07:00
parent 5b9472b466
commit 4da867cde1
4 changed files with 22 additions and 22 deletions

View file

@ -25,7 +25,7 @@ import {
createPermCondition,
} from "../services/permission";
import { filterStatus } from "../services/prisma";
import { throwRelationError } from "../utils/error";
import { relationError } from "../utils/error";
import { deleteFile, fileLocation, getFile, listFile, setFile } from "../utils/minio";
const MANAGE_ROLES = [
@ -253,7 +253,7 @@ export class ServiceController extends Controller {
}),
]);
if (!productGroup) return throwRelationError("Product Type");
if (!productGroup) throw relationError("Product Type");
await permissionCheck(req.user, productGroup.registeredBranch);