models enums services
This commit is contained in:
20
src/app/features/services/shop-info.service.ts
Normal file
20
src/app/features/services/shop-info.service.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { API_URL } from '../../core/tokens/api-url.token';
|
||||
import { AdminShopInfo } from '../../core/models/shop.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ShopInfoService {
|
||||
private http = inject(HttpClient);
|
||||
private apiUrl = inject(API_URL);
|
||||
private readonly endpoint = '/AdminShopInfo';
|
||||
|
||||
get(): Observable<AdminShopInfo> {
|
||||
return this.http.get<AdminShopInfo>(`${this.apiUrl}${this.endpoint}`);
|
||||
}
|
||||
|
||||
update(data: AdminShopInfo): Observable<void> {
|
||||
return this.http.put<void>(`${this.apiUrl}${this.endpoint}`, data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user