medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.1k stars 2.5k forks source link

`CreateProductInput` Type missing `external_id` ? #2497

Closed chiubaca closed 1 year ago

chiubaca commented 1 year ago

Bug report

Describe the bug

I'm using Typescript and trying to apply anexternal_id property when adding a new product and noticing TS errors :

Type '{ title: string; handle: string; thumbnail: string | undefined; options: { title: string; }[]; profile_id: string; external_id: string; metadata: { printful_id: number | undefined; }; }' is not assignable to type 'CreateProductInput'.

Is this perhaps just a mistyping in CreateProductInput interface ?

System information

Medusa version (including plugins): Node.js version: v16.13.0 Database: 1.5.0 Operating system: mac OS

Steps to reproduce the behaviour

create new CreateProductInput like so:


import { CreateProductInput } from "@medusajs/medusa/dist/types/product";

const productDataNew: CreateProductInput = {
  title: "product name",
  external_id: "external-id",
};

Expected behaviour

There should not be any TS errors.

chiubaca commented 1 year ago

A quick fix here if so - https://github.com/medusajs/medusa/pull/2498