Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add order edit #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/orderedits.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { orderEditsService } from './services'
import {
createStandardDelete
} from './helpers'
const nconf = require('nconf')

export const deleteOrderEdits = createStandardDelete({
itemName: 'order-edits',
service: orderEditsService
})


if (nconf.get('clean')) {
deleteOrderEdits()
}
6 changes: 6 additions & 0 deletions lib/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ const createCarts = () =>
createRequestBuilder({ projectKey: config.projectKey })
.carts

const createOrderEdits = () =>
createRequestBuilder({ projectKey: config.projectKey })
.orderEdits


export const projectService = createProjectService()
export const storeService = createStoreService()
export const zonesService = createZonesService()
Expand All @@ -105,3 +110,4 @@ export const channelsService = createChannels()
export const typesService = createTypes()
export const inventoryService = createInventory()
export const cartsService = createCarts()
export const orderEditsService = createOrderEdits()
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"clean:products": "npm run build && node dist/lib/products.js --clean",
"clean:taxCategories": "npm run build && node dist/lib/tax-categories.js --clean",
"clean:types": "npm run build && node dist/lib/types.js --clean",
"clean:order-edits": "npm run build && node dist/lib/orderedits.js --clean",
"start": "npm run build && node dist/lib/data.js --start",
"lint": "prettier --write ./lib/** && eslint --fix ./lib/**"
},
Expand Down