fix chat ui details

This commit is contained in:
Peter Maquiran
2024-09-09 10:28:53 +01:00
parent e7887d4e5a
commit 96daa01f94
20 changed files with 236 additions and 108 deletions
@@ -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)
}
}
@@ -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();
});
});
@@ -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)
}
}