refactor: helper function manual throw
This change is to prevent swagger to infer empty type from return type
This commit is contained in:
parent
5b9472b466
commit
4da867cde1
4 changed files with 22 additions and 22 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue