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

[Bug]: API call POST order archive using Postman #10328

Closed
dooke opened this issue Nov 27, 2024 · 1 comment · Fixed by #10340
Closed

[Bug]: API call POST order archive using Postman #10328

dooke opened this issue Nov 27, 2024 · 1 comment · Fixed by #10340

Comments

@dooke
Copy link

dooke commented Nov 27, 2024

Package.json file

{
  "name": "medusa-starter-default",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "^2.0.7",
    "@medusajs/cli": "^2.0.7",
    "@medusajs/framework": "^2.0.7",
    "@medusajs/medusa": "2.0.7",
    "@mikro-orm/core": "5.9.7",
    "@mikro-orm/knex": "5.9.7",
    "@mikro-orm/migrations": "5.9.7",
    "@mikro-orm/postgresql": "5.9.7",
    "@sendgrid/mail": "^8.1.4",
    "awilix": "^8.0.1",
    "pg": "^8.13.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "^2.0.7",
    "@mikro-orm/cli": "5.9.7",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v20.17.0

Database and its version

PostGresSQL 13

Operating system name and version

Mac Os

Browser name

Brave/Chrome

What happended?

Archive an order (Admin API)

Using Postman calling : POST http://localhost:9000/admin/orders/order_xxx/archive as described here https://docs.medusajs.com/api/admin#orders_postordersidarchive
(This call seems to be same as "Order complete" https://docs.medusajs.com/api/admin#orders_postordersidcomplete)

Result is :
{ message: "Trying to set Order.id of type 'string' to 'order_xxx' of type 'array'", name: 'ValidationError', stack: "ValidationError: Trying to set Order.id of type 'string' to 'order_xxx' of type 'array'\n" ... }

Expected behavior

Archive an order

Actual behavior

Error message : Trying to set Order.id of type 'string' to 'order_xxx' of type 'array'

Link to reproduction repo

http://localhost:9000

@fPolic
Copy link
Contributor

fPolic commented Nov 28, 2024

@dooke thanks for the report, we will fix this ASAP.

@fPolic fPolic self-assigned this Nov 28, 2024
@kodiakhq kodiakhq bot closed this as completed in #10340 Nov 28, 2024
kodiakhq bot pushed a commit that referenced this issue Nov 28, 2024
**What**
- array was passed as an id when updating order status upon archive

---

RESOLVES SUP-305
CLOSES #10328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants