Skip to content
Snippets Groups Projects
Commit 0f688689 authored by Gomez Goiri, Aitor's avatar Gomez Goiri, Aitor
Browse files

Adapting CLI to new statuses validated by chaincode

parent c9036e0d
Branches
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ const sendToCone = async (apiClient, { assetId: paramAssetId }) => {
const assetToBeSent = await apiClient.getAsset(assetId)
const assetsInCone = await apiClient.richQuery({
fields: {
status: STATUSES.SLAG_CONE
status: STATUSES.SLAG_BATCH
}
})
......@@ -75,7 +75,7 @@ const sendToCone = async (apiClient, { assetId: paramAssetId }) => {
? assetToBeSent.location
: assetsInCone[0].location,
fields: {
status: STATUSES.SLAG_CONE
status: STATUSES.SLAG_BATCH
}
}
)
......@@ -93,13 +93,13 @@ const sendToStock = async (apiClient, { assetId: paramAssetId }) => {
(await promptAssetSelection(
await apiClient.richQuery({
fields: {
status: STATUSES.SLAG_CONE
status: STATUSES.SLAG_BATCH
}
})
))
const assetToBeSent = await apiClient.getAsset(assetId)
if (assetToBeSent.fields.status !== STATUSES.SLAG_CONE) {
if (assetToBeSent.fields.status !== STATUSES.SLAG_BATCH) {
console.error("You can only combine a cone with a stock")
return
}
......
......@@ -45,9 +45,7 @@ const TYPES = {
const STATUSES = {
SLAG: "slag",
// TODO SLAG_CONE y SLAG_BATCH son lo mismo!
// SLAG_CONE: "escoria en cono",
SLAG_BATCH: "batched",
SLAG_BATCH: "batched", // escoria en cono
STOCK: "stocked",
SOLD: "sold",
DISCARDED: "discarded"
......
......@@ -33,7 +33,7 @@ const modifyUser = async (
return modUser
}
const createOrModifyUserIfNeeded = async (
const createOrModifyUserIfNeeded = (
apiClient,
username,
password,
......@@ -42,7 +42,7 @@ const createOrModifyUserIfNeeded = async (
) => {
try {
// Await is needed here to force the catch clausule if something goes wrong
return await apiClient.createUser(
return apiClient.createUser(
username,
password,
organization,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment