Skip to content

Commit

Permalink
Refactor product service
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Jan 10, 2024
1 parent 72ddeeb commit 17e7d60
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/app/directives/hover-color-picker-directive.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
import { ProductService } from '../services/product.service';
import { ProductService } from '../products/services/product.service';

@Directive({
selector: '[appHoverColorPicker]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component, OnInit, Input } from '@angular/core';
import { Router } from '@angular/router';
import { IoRestorecommerceProductPhysicalVariant } from 'src/app/generated/graphql';
import { ProductService } from 'src/app/services/product.service';
import { Product } from '../products/products.component';
import { ProductService } from '../../services/product.service';

@Component({
selector: 'app-product-card',
Expand Down Expand Up @@ -35,7 +34,7 @@ export class ProductCardComponent implements OnInit {
}

ngOnInit(): void {
this.selectedColor = 0;
this.selectedColor = 0;
}

onMouseEnter($event: string) {
Expand All @@ -50,7 +49,6 @@ export class ProductCardComponent implements OnInit {
// if (this.product.selectedColor === colorHovered) {
// return;
// }

// if (!this.product.colors.find((color) => color === colorHovered)) {
// this.selectedColor = this.product.selectedColor;
// } else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { map, switchMap } from 'rxjs';

import { ProductService } from 'src/app/services/product.service';
import { ProductService } from 'src/app/products/services/product.service';

@Component({
selector: 'app-product-variants',
Expand Down
2 changes: 1 addition & 1 deletion src/app/products/components/product/product.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ScreenService } from 'src/app/services/screen.service';
import { ProductService } from 'src/app/services/product.service';
import { ProductService } from 'src/app/products/services/product.service';
import { combineLatest, map, switchMap } from 'rxjs';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ProductService } from 'src/app/services/product.service';
import { ProductService } from 'src/app/products/services/product.service';

@Component({
selector: 'app-shoes-products',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Injectable, EventEmitter, OnDestroy } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Product } from '../models/product';
import { Product as ProductCard } from '../products/components/products/products.component';
import { Product } from '../../models/product';
import { Product as ProductCard } from '../components/products/products.component';
import { Subject, Subscription, map, catchError, of, tap } from 'rxjs';
import {
IoRestorecommerceProductProduct,
IoRestorecommerceResourcebaseFilterOperation,
ProductsQueryGQL,
} from '../generated/graphql';
import { Observable } from '@apollo/client/utilities';
} from '../../generated/graphql';

@Injectable({
providedIn: 'root',
Expand Down
7 changes: 0 additions & 7 deletions src/app/services/Product-detail.service.ts

This file was deleted.

0 comments on commit 17e7d60

Please sign in to comment.