Image Upload, spinner aktivirt, listings & details überarbeitet
This commit is contained in:
@@ -4,6 +4,7 @@ import { Entity, Repository, Schema } from 'redis-om';
|
||||
import { ListingCriteria, User } from '../models/main.model.js';
|
||||
import { REDIS_CLIENT } from '../redis/redis.module.js';
|
||||
import { UserEntity } from '../models/server.model.js';
|
||||
import { FileService } from '../file/file.service.js';
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
@@ -24,12 +25,15 @@ export class UserService {
|
||||
}, {
|
||||
dataStructure: 'JSON'
|
||||
})
|
||||
constructor(@Inject(REDIS_CLIENT) private readonly redis: any){
|
||||
constructor(@Inject(REDIS_CLIENT) private readonly redis: any,private fileService:FileService){
|
||||
this.userRepository = new Repository(this.userSchema, redis)
|
||||
this.userRepository.createIndex();
|
||||
}
|
||||
async getUserById( id:string){
|
||||
return await this.userRepository.fetch(id);
|
||||
const user = await this.userRepository.fetch(id) as UserEntity;
|
||||
user.hasCompanyLogo=this.fileService.hasCompanyLogo(id);
|
||||
user.hasProfile=this.fileService.hasProfile(id);
|
||||
return user;
|
||||
}
|
||||
async saveUser(user:any):Promise<UserEntity>{
|
||||
return await this.userRepository.save(user.id,user) as UserEntity
|
||||
|
||||
Reference in New Issue
Block a user