db switcher updates
This commit is contained in:
parent
a695cc8f4e
commit
ed2761d90a
@ -69,7 +69,7 @@ export class CarnetService {
|
|||||||
const data = {
|
const data = {
|
||||||
P_SPID: this.userService.getUserSpid(),
|
P_SPID: this.userService.getUserSpid(),
|
||||||
P_HEADERID: headerid,
|
P_HEADERID: headerid,
|
||||||
P_PRINTGL: 'N'
|
P_PRINTGL: 'Y'
|
||||||
}
|
}
|
||||||
return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintCarnet`, data, {
|
return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintCarnet`, data, {
|
||||||
responseType: 'blob', // Important: Set responseType to 'blob'
|
responseType: 'blob', // Important: Set responseType to 'blob'
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { ApiErrorHandlerService } from './api-error-handler.service';
|
|||||||
export class AuthService {
|
export class AuthService {
|
||||||
private apiUrl = environment.apiUrl;
|
private apiUrl = environment.apiUrl;
|
||||||
private applicationName = environment.appType;
|
private applicationName = environment.appType;
|
||||||
|
private apiDb = environment.apiDb;
|
||||||
|
|
||||||
private http = inject(HttpClient);
|
private http = inject(HttpClient);
|
||||||
private userService = inject(UserService);
|
private userService = inject(UserService);
|
||||||
@ -25,16 +26,16 @@ export class AuthService {
|
|||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
|
|
||||||
login(username: string, password: string): Observable<any> {
|
login(username: string, password: string): Observable<any> {
|
||||||
return this.http.post(`${this.apiUrl}/login`, { p_emailaddr: username, p_password: password, P_APPLICATIONNAME: this.applicationName });
|
return this.http.post(`${this.apiUrl}/${this.apiDb}/login`, { p_emailaddr: username, p_password: password, P_APPLICATIONNAME: this.applicationName });
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshToken(): Observable<any> {
|
refreshToken(): Observable<any> {
|
||||||
return this.http.get(`${this.apiUrl}/refresh-tokens`, {});
|
return this.http.get(`${this.apiUrl}/${this.apiDb}/refresh-tokens`, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(): void {
|
logout(): void {
|
||||||
if (this.userService.isLoggedIn()) {
|
if (this.userService.isLoggedIn()) {
|
||||||
this.http.post(`${this.apiUrl}/logout`, {}).subscribe({
|
this.http.post(`${this.apiUrl}/${this.apiDb}/logout`, {}).subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
this.userService.clearUser();
|
this.userService.clearUser();
|
||||||
this.storageService.clear();
|
this.storageService.clear();
|
||||||
@ -53,7 +54,7 @@ export class AuthService {
|
|||||||
register(email: string, password: string): Observable<any> {
|
register(email: string, password: string): Observable<any> {
|
||||||
|
|
||||||
return this.http.post(
|
return this.http.post(
|
||||||
`${this.apiUrl}/register`,
|
`${this.apiUrl}/${this.apiDb}/register`,
|
||||||
{ P_EMAILADDR: email, P_PASSWORD: password }
|
{ P_EMAILADDR: email, P_PASSWORD: password }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -66,7 +67,7 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.http.put(
|
return this.http.put(
|
||||||
`${this.apiUrl}/forgot-password`,
|
`${this.apiUrl}/${this.apiDb}/forgot-password`,
|
||||||
{ P_EMAILADDR: email, P_PASSWORD: password },
|
{ P_EMAILADDR: email, P_PASSWORD: password },
|
||||||
{ headers }
|
{ headers }
|
||||||
);
|
);
|
||||||
@ -74,7 +75,7 @@ export class AuthService {
|
|||||||
|
|
||||||
sendEmail(email: string, type: string): Observable<any> {
|
sendEmail(email: string, type: string): Observable<any> {
|
||||||
return this.http.post(
|
return this.http.post(
|
||||||
`${this.apiUrl}/sendmail`,
|
`${this.apiUrl}/${this.apiDb}/sendmail`,
|
||||||
{ P_TO: email, P_MAIL_TYPE: type }
|
{ P_TO: email, P_MAIL_TYPE: type }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: 'https://dev.alphaomegainfosys.com/test-api',
|
apiUrl: 'https://dev.alphaomegainfosys.com/test-api',
|
||||||
apiDb: 'oracle',
|
apiDb: '1',
|
||||||
appType: 'client',
|
appType: 'client',
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
apiUrl: 'https://dev.alphaomegainfosys.com/test-api',
|
apiUrl: 'https://dev.alphaomegainfosys.com/test-api',
|
||||||
apiDb: 'oracle',
|
apiDb: '1',
|
||||||
appType: 'client',
|
appType: 'client',
|
||||||
};
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user