diff --git a/packages/sdk-api-client/src/setup/clientSetup.ts b/packages/sdk-api-client/src/setup/clientSetup.ts index e8a350ab..2b78174c 100644 --- a/packages/sdk-api-client/src/setup/clientSetup.ts +++ b/packages/sdk-api-client/src/setup/clientSetup.ts @@ -25,7 +25,7 @@ const buildClient = (settings: MiddlewareConfig) => { fetch, fetchOptions: settings.fetchOptions, headers: { - Cookie: settings.sessionAuth, + Cookie: `session_id=${settings.sessionAuth}`, 'resquest-host': settings.requestHost, 'REAL-IP': settings.realIp } diff --git a/playground-nuxt/app/pages/index.vue b/playground-nuxt/app/pages/index.vue index cbe2cb19..d986a741 100644 --- a/playground-nuxt/app/pages/index.vue +++ b/playground-nuxt/app/pages/index.vue @@ -5,23 +5,25 @@ import { MutationName } from '~/server/mutations'; const { $sdk } = useNuxtApp(); -const { data } = await $sdk().odoo.query({ queryName: QueryName.ProductVariantQuery }, { - productTemplateId: 39, - combinationId: [12, 305] -}); +const go = async () => { + const { data } = await $sdk().odoo.mutation({ mutationName: MutationName.LoginMutation }, { + email: "ergap@odoo.com", + password: "123" + }); -console.log(data.productVariant.displayName); + console.log(data?.login); -const { data: dataMut } = await $sdk().odoo.mutation({ mutationName: MutationName.LoginMutation }, { - email: "test@odoo.com", - password: "123" -}); + const { data: asa } = await $sdk().odoo.query({ queryName: QueryName.LoadUserQuery }, {}); + + console.log(asa.productVariant.displayName); +};