mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
feat: cookie maxAge increase & added search param to users fetch
This commit is contained in:
parent
417d236cbb
commit
8a45389d0d
@ -64,10 +64,17 @@ export default class UserRepository {
|
||||
* @returns Array of users
|
||||
*/
|
||||
public async getAll(params?: any) {
|
||||
const { email, login, first_name, last_name, role, page = 1, limit = 10 }: any = params || {};
|
||||
const { search, email, login, first_name, last_name, role, page = 1, limit = 10 }: any = params || {};
|
||||
|
||||
const query = this.User.query();
|
||||
|
||||
if (search) {
|
||||
query
|
||||
.where('first_name', 'ilike', `%${search}%`)
|
||||
.orWhere('last_name', 'ilike', `%${search}%`)
|
||||
.orWhere('email', 'ilike', `%${search}%`);
|
||||
}
|
||||
|
||||
if (email) {
|
||||
query.preload('contacts').whereHas('contacts', q => q.where('email', 'like', `%${email}%`));
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ export const http: ServerConfig = {
|
||||
cookie: {
|
||||
domain: '',
|
||||
path: '/',
|
||||
maxAge: '2h',
|
||||
maxAge: '1d',
|
||||
httpOnly: true,
|
||||
secure: false,
|
||||
sameSite: false,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user