Added product admin features
This commit is contained in:
+14
-12
@@ -9,33 +9,34 @@ import resolvers from './resolvers';
|
||||
import { OrderAPI } from './datasources/order-api';
|
||||
import { ProductAPI } from './datasources/product-api';
|
||||
import { DesignerAPI } from './datasources/designer-api';
|
||||
import { Api2DataSource } from './datasources/api2-datasource';
|
||||
import { Api1DataSource } from './datasources/api1-datasource';
|
||||
|
||||
import { verifyToken } from './cognito/cognito-client';
|
||||
import { CategoryAPI } from './datasources/category-api';
|
||||
import { KeywordAPI } from './datasources/keyword-api';
|
||||
import { MarketAPI } from './datasources/market-api';
|
||||
import { ImageServerApi } from './datasources/imageserver-api';
|
||||
import { InteriorAPI } from './datasources/interior-api';
|
||||
|
||||
console.log(`dbConfig`, dbConfig);
|
||||
import { verifyToken } from './cognito/cognito-client';
|
||||
|
||||
// Should we convert columns?
|
||||
const knexConfig = knexStringcase(dbConfig);
|
||||
|
||||
// set up any dataSources our resolvers need
|
||||
const api1 = new Api1DataSource();
|
||||
const api2 = new Api2DataSource();
|
||||
const categoryApi = new CategoryAPI(knexConfig);
|
||||
const designerApi = new DesignerAPI(knexConfig);
|
||||
const imageServerApi = new ImageServerApi();
|
||||
const interiorApi = new InteriorAPI(knexConfig, imageServerApi);
|
||||
const keywordApi = new KeywordAPI(knexConfig);
|
||||
const marketApi = new MarketAPI(knexConfig);
|
||||
const orderApi = new OrderAPI(knexConfig);
|
||||
const productApi = new ProductAPI(knexConfig);
|
||||
const categoryApi = new CategoryAPI(knexConfig);
|
||||
const keywordApi = new KeywordAPI(knexConfig);
|
||||
const designerApi = new DesignerAPI(knexConfig);
|
||||
|
||||
const dataSources = () => ({
|
||||
api1,
|
||||
api2,
|
||||
categoryApi,
|
||||
designerApi,
|
||||
interiorApi,
|
||||
imageServerApi,
|
||||
keywordApi,
|
||||
marketApi,
|
||||
orderApi,
|
||||
productApi,
|
||||
});
|
||||
@@ -51,6 +52,7 @@ const context = async ({ req }) => {
|
||||
const res = await verifyToken({ token });
|
||||
return { auth: res };
|
||||
} else if (authHeader == 'Basic ZGV2OmRldg==') {
|
||||
// dev:dev remove later
|
||||
return { auth: 'during development' };
|
||||
}
|
||||
throw new AuthenticationError('Not authorized');
|
||||
|
||||
Reference in New Issue
Block a user