Skip to content

Commit

Permalink
Show Products For Admin Also Low InStock
Browse files Browse the repository at this point in the history
  • Loading branch information
almirhodzic committed Feb 24, 2024
1 parent 650cd89 commit 7ecab38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/secure/products/products.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ProductService } from '../../services/product.service';
import { ToastrService } from 'ngx-toastr';
import { CategoryService } from '../../services/category.service';
import { CartService } from 'src/app/services/cart.service';
import { ProductadminService } from 'src/app/services/productadmin.service';

@Component({
selector: 'app-products',
Expand All @@ -25,15 +26,16 @@ export class ProductsComponent implements OnInit {
private productService: ProductService,
private toastr: ToastrService,
private categoryService: CategoryService,
private cartService: CartService
private cartService: CartService,
private productAdminService: ProductadminService,
) { }

ngOnInit(): void {
this.load();
}

load(): void {
this.productService.all(this.page).subscribe(
this.productAdminService.all(this.page).subscribe(
res => {
this.products = res.data;
this.lastPage = res.meta.last_page;
Expand Down
10 changes: 10 additions & 0 deletions src/app/services/productadmin.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';
import { RestService } from './rest.service';
import { environment } from '../environments/environment';

@Injectable({
providedIn: 'root'
})
export class ProductadminService extends RestService {
endpoint = `${environment.api}/productadmin`;
}

0 comments on commit 7ecab38

Please sign in to comment.