mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
fix: fixed ts types
This commit is contained in:
parent
303a27089b
commit
ff97175fbe
@ -56,7 +56,6 @@ class RedisSessionStore {
|
||||
public async getSessions(): Promise<Array<SessionDataType | undefined>> {
|
||||
const keys = await this.scanSessionKeys();
|
||||
const commands = Array.from(keys).map(key => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [, ...id] = key.split('-');
|
||||
return ['hmget', id.join('-'), 'userId', 'userName', 'connected'];
|
||||
});
|
||||
@ -64,7 +63,10 @@ class RedisSessionStore {
|
||||
return this.redisClient
|
||||
.multi(commands)
|
||||
.exec()
|
||||
.then(results => results.map(([err, session]) => (err ? undefined : this.transform(session))));
|
||||
.then(results => {
|
||||
if (results === null) return [];
|
||||
return results.map(([err, session]: [Error, (string | null)[]]) => (err ? undefined : this.transform(session)));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -7,7 +7,7 @@ export default class UpdateUserInfoValidator {
|
||||
public schema = schema.create({
|
||||
about: schema.string.nullableAndOptional(),
|
||||
phone_number: schema.string.nullableAndOptional({}, [
|
||||
rules.mobile({ locales: ['ru-RU', 'en-US'], strict: true }),
|
||||
rules.mobile({ locale: ['ru-RU', 'en-US'], strict: true }),
|
||||
rules.unique({ table: 'contacts', column: 'phone_number' }),
|
||||
]),
|
||||
vk_id: schema.string.nullableAndOptional({}, [
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import Factory from '@ioc:Adonis/Lucid/Factory';
|
||||
import Factory, { FactoryContextContract } from '@ioc:Adonis/Lucid/Factory';
|
||||
import { string } from '@ioc:Adonis/Core/Helpers';
|
||||
|
||||
/**
|
||||
@ -18,7 +18,7 @@ import Role from 'App/Models/Role';
|
||||
import User from 'App/Models/User';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
const makeFakeUser = (faker: Faker.FakerStatic, loginPrefix?: string) => {
|
||||
const makeFakeUser = (faker: FactoryContextContract['faker'], loginPrefix?: string) => {
|
||||
return {
|
||||
first_name: faker.name.firstName(),
|
||||
last_name: faker.name.lastName(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user