diff --git a/src/datasources/imageserver-api.ts b/src/datasources/imageserver-api.ts index 07ef01e..cf6915c 100644 --- a/src/datasources/imageserver-api.ts +++ b/src/datasources/imageserver-api.ts @@ -11,18 +11,10 @@ export class ImageServerApi extends RESTDataSource { : 'http://images-dev.photowall.com'; } - willSendRequest(request) { - request.headers.set('X-Photowall', 'pele'); - } - async getInteriorsForProduct( productId: number, - type: InteriorType, - orientation: Orientation, ): Promise> { - const it = type.toString().toLowerCase(); - const or = orientation.toString().toLowerCase(); - return this.get(`/rooms/${productId}/${or}/${it}/`, null, { + return this.get(`/rooms/${productId}/`, null, { cacheOptions: { ttl: 5 }, }); } diff --git a/src/datasources/interior-api.ts b/src/datasources/interior-api.ts index 6894033..faa7349 100644 --- a/src/datasources/interior-api.ts +++ b/src/datasources/interior-api.ts @@ -51,7 +51,6 @@ export class InteriorAPI extends BaseSQLDataSource { } decorateRow(row: any): Interior { - console.log('row', row); if (row.roomName) { const parts = row.roomName.split('_'); row.roomNumber = this.getInteriorRoomNumber(parts[0]); @@ -86,8 +85,6 @@ export class InteriorAPI extends BaseSQLDataSource { if (filter) { const validUris = await this.imageServerApi.getInteriorsForProduct( filter.productId, - filter.type, - filter.orientation, ); return allInteriors.filter((i: Interior) => { const it = i.type.toString().toLowerCase(); diff --git a/src/schema.graphql b/src/schema.graphql index ee0c137..457aee2 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -64,13 +64,8 @@ type ProductsResult { items: [Product] } -""" -Only return valid interiors for product, type and orientation -""" input InteriorsFilterInput { productId: Int! - type: InteriorType! - orientation: Orientation! } type Market { diff --git a/src/types/interior-types.ts b/src/types/interior-types.ts index 382ad70..d91f9c1 100644 --- a/src/types/interior-types.ts +++ b/src/types/interior-types.ts @@ -20,8 +20,6 @@ export enum InteriorType { export interface InteriorsFilter { productId: number; - type: InteriorType; - orientation: Orientation; } export interface InteriorsFilterInput {