mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix donwload attachment and modal to edit message
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { liveQuery } from 'Dexie';
|
||||
import { err, ok, Result } from 'neverthrow';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { MessageEntity } from '../../../../../core/chat/entity/message';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
import { Observable as DexieObservable, PromiseExtended } from 'Dexie';
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Result } from 'neverthrow';
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { AddMemberToRoomInputDTO, AddMemberToRoomInputDTOSchema } from '../../../domain/use-case/member/member-add-use-case.service';
|
||||
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
||||
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
|
||||
import { AddMemberToRoomInputDTO } from '../../../domain/use-case/member/member-add-use-case.service';
|
||||
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { MemberSetAdminDTO } from '../../../domain/use-case/member/member-admin-use-case.service';
|
||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { CreateRoomInputDTOSchema, CreateRoomInputDTO, RoomOutPutDTOSchema, RoomOutPutDTO } from '../../../domain/use-case/room/room-create-use-case.service';
|
||||
import { CreateRoomInputDTO, RoomOutPutDTO } from '../../../domain/use-case/room/room-create-use-case.service';
|
||||
import { IRoomRemoteRepository } from 'src/app/core/chat/repository/room/room-remote-repository';
|
||||
import { RoomByIdInputDTO, RoomByIdInputDTOSchema, RoomByIdOutputDTO, RoomByIdOutputDTOSchema } from 'src/app/module/chat/domain/use-case/room/room-get-by-id-use-case.service';
|
||||
import { RoomUpdateInputDTO, RoomUpdateInputDTOSchema, RoomUpdateOutputDTO } from 'src/app/module/chat/domain/use-case/room/room-update-by-id-use-case.service';
|
||||
import { RoomListOutPutDTO, RoomListOutPutDTOSchema } from '../../../domain/use-case/room/room-get-list-use-case.service';
|
||||
import { RoomByIdOutputDTO } from 'src/app/module/chat/domain/use-case/room/room-get-by-id-use-case.service';
|
||||
import { RoomUpdateInputDTO, RoomUpdateOutputDTO } from 'src/app/module/chat/domain/use-case/room/room-update-by-id-use-case.service';
|
||||
import { RoomListOutPutDTO } from '../../../domain/use-case/room/room-get-list-use-case.service';
|
||||
import { z } from 'zod';
|
||||
|
||||
const RoomByIdInputDTOSchema = z.string()
|
||||
type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -28,25 +30,25 @@ export class RoomRemoteDataSourceService implements IRoomRemoteRepository {
|
||||
) {}
|
||||
|
||||
|
||||
@ValidateSchema(CreateRoomInputDTOSchema)
|
||||
@APIReturn(RoomOutPutDTOSchema, 'post/Room')
|
||||
//@ValidateSchema(CreateRoomInputDTOSchema)
|
||||
//@APIReturn(RoomOutPutDTOSchema, 'post/Room')
|
||||
async createRoom(data: CreateRoomInputDTO): DataSourceReturn<RoomOutPutDTO> {
|
||||
return await this.httpService.post<RoomOutPutDTO>(`${this.baseUrl}/Room`, data);
|
||||
}
|
||||
|
||||
|
||||
@APIReturn(RoomListOutPutDTOSchema, 'get/Room')
|
||||
//@APIReturn(RoomListOutPutDTOSchema, 'get/Room')
|
||||
async getRoomList(): Promise<DataSourceReturn<RoomListOutPutDTO>> {
|
||||
return await this.httpService.get<RoomListOutPutDTO>(`${this.baseUrl}/Room?userId=${SessionStore.user.UserId}`);
|
||||
}
|
||||
|
||||
@ValidateSchema(RoomByIdInputDTOSchema)
|
||||
@APIReturn(RoomByIdOutputDTOSchema,'get/Room/${id}')
|
||||
//@ValidateSchema(RoomByIdInputDTOSchema)
|
||||
//@APIReturn(RoomByIdOutputDTOSchema,'get/Room/${id}')
|
||||
async getRoom(id: RoomByIdInputDTO): DataSourceReturn<RoomByIdOutputDTO> {
|
||||
return await this.httpService.get(`${this.baseUrl}/Room/${id}`);
|
||||
}
|
||||
|
||||
@ValidateSchema(RoomUpdateInputDTOSchema)
|
||||
//@ValidateSchema(RoomUpdateInputDTOSchema)
|
||||
//@APIReturn(RoomByIdOutputDTOSchema,'update/Room/${id}')
|
||||
async updateRoom(data: RoomUpdateInputDTO): Promise<DataSourceReturn<RoomUpdateOutputDTO>> {
|
||||
const id = data.roomId
|
||||
|
||||
Reference in New Issue
Block a user