Migrate exchange backend from Django to Express + Apollo Server + Prisma
All checks were successful
Build Docker Image / build (push) Successful in 1m54s
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.
This commit is contained in:
22
src/services/odoo.ts
Normal file
22
src/services/odoo.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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 []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user