mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix publication
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { HttpModule } from 'src/app/infra/http/http.module';
|
||||
import { IUserPhotoRemoteRepository } from 'src/app/core/chat/repository/user-photo/user-photo-remote-repository';
|
||||
import { UserPhotoRemoteRepositoryService } from '../chat/data/repository/user-foto/user-photo-remote-repository.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [HttpModule],
|
||||
providers: [
|
||||
{
|
||||
provide: IUserPhotoRemoteRepository,
|
||||
useClass: UserPhotoRemoteRepositoryService
|
||||
},
|
||||
],
|
||||
declarations: [],
|
||||
schemas: [],
|
||||
entryComponents: []
|
||||
})
|
||||
export class ActionsModule {
|
||||
constructor() {}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionsCreateInput } from 'src/app/core/actions/use-case/actions-create-use-case.service';
|
||||
import { ActionGetAllOutPut } from 'src/app/core/actions/use-case/actions-get-all-use-case.service';
|
||||
import { ActionsUpdateInput } from 'src/app/core/actions/use-case/actions-update-use-case.service';
|
||||
import { PublicationGetDocumentByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-get-documents-by-document-id.service';
|
||||
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
||||
import { HttpService } from 'src/app/infra/http/http.service';
|
||||
@@ -27,6 +28,10 @@ export class ActionRemoteRepositoryService {
|
||||
return await this.http.post<ApiResponse<any>>(`${this.baseUrl}`, input);
|
||||
}
|
||||
|
||||
async update(input: ActionsUpdateInput) {
|
||||
return await this.http.put<ApiResponse<any>>(`${this.baseUrl}/${input.processId}`, input);
|
||||
}
|
||||
|
||||
async postGetListByProcessId(processId: string) {
|
||||
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpService } from 'src/app/infra/http/http.service';
|
||||
import { ApiResponse } from 'src/app/infra/http/type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationFileRepositoryService {
|
||||
|
||||
constructor() { }
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/PresidentialActions`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private http: HttpService
|
||||
) { }
|
||||
|
||||
async deleteFile(path: string) {
|
||||
return await this.http.delete<ApiResponse<any>>(
|
||||
`${this.baseUrl}/posts/file`,{ path }
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PublicationCreateInputDto } from 'src/app/core/actions/use-case/publication-create-use-case.service';
|
||||
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
||||
import { PublicationUpdateInputDto } from 'src/app/core/actions/use-case/publication-update-use-case.service';
|
||||
import { HttpService } from 'src/app/infra/http/http.service';
|
||||
import { ApiResponse } from 'src/app/infra/http/type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@@ -18,4 +20,12 @@ export class PublicationRemoteRepositoryService {
|
||||
async listByProcessId(processId: number) {
|
||||
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
||||
}
|
||||
|
||||
async createPublication(input: PublicationCreateInputDto) {
|
||||
return await this.http.post<ApiResponse<PublicationCreateInputDto>>(`${this.baseUrl}/${input.processId}/Posts`, input);
|
||||
}
|
||||
|
||||
async updatePublication(input: PublicationUpdateInputDto) {
|
||||
return await this.http.put<ApiResponse<PublicationUpdateInputDto>>(`${this.baseUrl}/${input.processId}/Posts/${input.documentId}`, input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,15 @@ export function messageListDetermineChanges(serverList: MessageTable[], localLis
|
||||
return localItem && (item.editedAt !== localItem.editedAt || item.isDeleted !== localItem.isDeleted || item.sentAt != item.sentAt || item.reactions.some((r, index) => {
|
||||
const localReaction = localItem.reactions[index];
|
||||
return !localReaction || r.reactedAt !== localReaction.reactedAt;
|
||||
}));
|
||||
}) ||
|
||||
item.info.some((info, index) => {
|
||||
const localInfo = localItem.info[index];
|
||||
return !localInfo ||
|
||||
info.memberId !== localInfo.memberId ||
|
||||
info.readAt !== localInfo.readAt ||
|
||||
info.deliverAt !== localInfo.deliverAt ||
|
||||
info.isDeleted !== localInfo.isDeleted;
|
||||
})) ;
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { IUserRemoteRepository } from 'src/app/core/user/repository/user-remote-repository';
|
||||
import { UserLoginInput, UserLoginUseCaseService } from 'src/app/core/user/use-case/user-login-use-case.service';
|
||||
import { UserLogOutUseCaseService } from 'src/app/core/user/use-case/user-log-out-use-case.service';
|
||||
import { SessionStore } from './service/session.service'
|
||||
import { UserEntity } from 'src/app/core/user/entity/userEntity';
|
||||
import { UserRefreshTokenService } from 'src/app/core/user/use-case/user-refresh-token.service';
|
||||
//import { initOpenReplay } from 'src/app/infra/open-replay';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -21,8 +20,7 @@ export class UserService {
|
||||
const result = await this.userLoginUseCaseService.execute(input)
|
||||
|
||||
if(result.isOk()) {
|
||||
|
||||
// SessionStore.reset(new UserEntity({...result.value, ...result.value.user}))
|
||||
//initOpenReplay();
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user