feat: Implement product management features including CRUD operations and UI components

This commit is contained in:
2025-12-05 00:01:48 +03:30
parent 3bc1202c77
commit 0419ff2fc7
36 changed files with 377 additions and 48 deletions
@@ -1,3 +1,4 @@
import { IPaginatedResponse } from '@/core/models/service.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
@@ -10,8 +11,8 @@ export class UsersService {
private apiRoutes = USERS_API_ROUTES;
getAll(): Observable<IUserResponse[]> {
return this.http.get<IUserRawResponse[]>(this.apiRoutes.list());
getAll(): Observable<IPaginatedResponse<IUserResponse>> {
return this.http.get<IPaginatedResponse<IUserRawResponse>>(this.apiRoutes.list());
}
getSingle(userId: string): Observable<IUserResponse> {
return this.http.get<IUserRawResponse>(this.apiRoutes.single(userId));
@@ -5,7 +5,7 @@
[showAdd]="true"
emptyPlaceholderTitle="کاربری یافت نشد"
emptyPlaceholderDescription="برای افزودن کاربر جدید، روی دکمهٔ بالا کلیک کنید."
[items]="[]"
[items]="items()"
[loading]="loading()"
[showDetails]="true"
[showAdd]="true"
@@ -37,8 +37,10 @@ export class UsersComponent {
getData() {
this.loading.set(true);
this.userService.getAll().subscribe((res) => {
console.log(res);
this.loading.set(false);
this.items.set(res);
this.items.set(res.data);
});
}