server recognizes db, read/write is up
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import createError from 'http-errors';
|
||||
import { IUser } from '../schemas';
|
||||
import { User } from "../models/user";
|
||||
const UserInstance = new User();
|
||||
|
||||
@@ -13,6 +14,16 @@ export default class UserCtl {
|
||||
}
|
||||
}
|
||||
|
||||
async post(data: IUser) {
|
||||
try {
|
||||
const response = await UserInstance.post(data);
|
||||
// if (!response) throw createError(400, "Bad request");
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// async getOne(id: string) {
|
||||
// try {
|
||||
// const user = await UserInstance.getOneByID(id);
|
||||
|
||||
Reference in New Issue
Block a user