import { Pool, type QueryResult, type QueryResultRow } from 'pg';
import { Pool, QueryResult, QueryResultRow } from 'pg';
if (result instanceof Error) {
return next(result);
}
.then((result) => result)
getAllUsers: function getAllUsers(): Promise<QueryResult<UsersType>> | тут промис с ошибкой, но его не нашел в @types/pg {
return db
.query('SELECT * FROM users ORDER BY user_id ASC')
.then((result) => result)
.catch((error) => error);
},
export default {
query: (text, params?) => pool.query(text, params),
getClient: (): Promise<PoolClient> => pool.connect()
}
// POST: /api/accounts/:id/frends/:id
// DELETE: /api/accounts/:id/frends/:id
//-
// POST: /api/posts/:id/comments/:id/likes
// DELETE: /api/posts/:id/comments/:id/likes