mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix chat ui details
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import Dexie, { PromiseExtended } from 'Dexie';
|
||||
import { IUserPhotoLocalRepository } from 'src/app/core/chat/repository/user-photo/user-photo-local-repository';
|
||||
import { UserPhotoTable, UserPhotoTableSchema } from 'src/app/infra/database/dexie/instance/chat/schema/user-foto';
|
||||
import { chatDatabase } from 'src/app/infra/database/dexie/service';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserPhotoLocalRepository extends DexieRepository<UserPhotoTable, UserPhotoTable> implements IUserPhotoLocalRepository {
|
||||
constructor() {
|
||||
super(chatDatabase.userPhoto, UserPhotoTableSchema)
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UserPhotoRemoteRepositoryService } from './user-photo-remote-repository.service';
|
||||
|
||||
describe('UserPhotoRemoteRepositoryService', () => {
|
||||
let service: UserPhotoRemoteRepositoryService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(UserPhotoRemoteRepositoryService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+17
-8
@@ -1,15 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import Dexie, { PromiseExtended } from 'Dexie';
|
||||
import { IUserPhotoLocalRepository } from 'src/app/core/chat/repository/user-photo/user-photo-local-repository';
|
||||
import { UserPhotoTable, UserPhotoTableSchema } from 'src/app/infra/database/dexie/instance/chat/schema/user-foto';
|
||||
import { chatDatabase } from 'src/app/infra/database/dexie/service';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
import { IGetUserPhotoByAttachmentId, IGetUserPhotoByAttachmentIdInputSchema, IUserPhotoRemoteRepository } from 'src/app/core/chat/repository/user-photo/user-photo-remote-repository';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||
import { SafeValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { z } from 'zod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserPhotoRemoteRepository extends DexieRepository<UserPhotoTable, UserPhotoTable> implements IUserPhotoLocalRepository {
|
||||
constructor() {
|
||||
super(chatDatabase.userPhoto, UserPhotoTableSchema)
|
||||
export class UserPhotoRemoteRepositoryService implements IUserPhotoRemoteRepository{
|
||||
|
||||
constructor(
|
||||
private http: HttpAdapter
|
||||
) { }
|
||||
|
||||
@SafeValidateSchema(IGetUserPhotoByAttachmentIdInputSchema, 'GET/UserAuthentication/GetPhoto?UserPhoto=')
|
||||
getUserPhotoByAttachmentId(input: IGetUserPhotoByAttachmentId) {
|
||||
const geturl = environment.apiURL + `UserAuthentication/GetPhoto?UserPhoto=${input.attachmentId}`;
|
||||
|
||||
return this.http.get<string>(geturl)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user