linefusion / indirectus

18 stars 5 forks source link

Bug: Decimal fields are typed as "number" when in reality a formatted string is returned #8

Open josias-r opened 3 weeks ago

josias-r commented 3 weeks ago

Description of the bug

When a field in directus is set to type "decimal" (for finances for example), the generated types say the response is a number, when in reality it is a formatted string, such as "100.00"

Steps To Reproduce

No response

Additional Information

No response

WoLfulus commented 3 weeks ago

Which database you're using?

josias-r commented 3 weeks ago

@WoLfulus PostgreSQL v15 hosted on Vercel, Directus 10.10.4

const config = await directusClient.shop_item({
  fields: [
    { column_name: ["current_price"] },
  ],
});

image