mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add logout v2
This commit is contained in:
@@ -7,6 +7,7 @@ import { TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||
import { IUserRepositoryLoginParams } from 'src/app/core/user/repository/user-remote-repository';
|
||||
import { UserLoginOutput } from 'src/app/core/user/use-case/user-login-use-case.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -26,6 +27,12 @@ export class UserRemoteRepositoryService {
|
||||
return await this.http.post<UserLoginOutput>(`${this.baseUrl}/Users/login`, input)
|
||||
}
|
||||
|
||||
// @APIReturn(MessageOutPutDTOSchema, 'get/Messages')
|
||||
async logout() {
|
||||
|
||||
return await this.http.post<UserLoginOutput>(`${this.baseUrl}/Users/${SessionStore.user.UserId}/logout`, {})
|
||||
}
|
||||
|
||||
getUserProfilePhoto(guid: string, tracing?: TracingType) {
|
||||
const geturl = environment.apiURL + 'UserAuthentication/GetPhoto';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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';
|
||||
@Injectable({
|
||||
@@ -10,6 +11,7 @@ export class UserService {
|
||||
|
||||
constructor(
|
||||
private userLoginUseCaseService: UserLoginUseCaseService,
|
||||
private userLogOutUseCaseService: UserLogOutUseCaseService
|
||||
) { }
|
||||
|
||||
|
||||
@@ -23,4 +25,8 @@ export class UserService {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
async logout() {
|
||||
return await this.userLogOutUseCaseService.execute()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user