All checks were successful
Build Docker Image / build (push) Successful in 1m54s
Replace Python/Django/Graphene with TypeScript/Express/Apollo Server. Same 4 endpoints (public/user/team/m2m), same JWT auth. Prisma replaces Django ORM for Offer/Request/SupplierProfile. Temporal and Odoo integrations preserved.
23 lines
570 B
TypeScript
23 lines
570 B
TypeScript
const ODOO_INTERNAL_URL = process.env.ODOO_INTERNAL_URL || 'odoo:8069'
|
|
|
|
interface Product {
|
|
uuid: string
|
|
name: string
|
|
category_id?: string
|
|
category_name?: string
|
|
terminus_schema_id?: string
|
|
}
|
|
|
|
export async function getProducts(): Promise<Product[]> {
|
|
try {
|
|
const res = await fetch(`http://${ODOO_INTERNAL_URL}/fastapi/products/products`, {
|
|
signal: AbortSignal.timeout(10000),
|
|
})
|
|
if (!res.ok) return []
|
|
return (await res.json()) as Product[]
|
|
} catch (e) {
|
|
console.error('Error fetching products from Odoo:', e)
|
|
return []
|
|
}
|
|
}
|