We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to expand the retrieveCompany() method to attach an array of all orders as well.
retrieveCompany()
It should be extremely straight forward but I simply cannot get it to work.
When I add the *orders like below to fetch orders as well the validator on the server keeps complaining:
*orders
error: Requested fields [orders] are not valid
I have added it to the validator though like so:
export const storeCompanyFields = [ "id", "name", "logo_url", "email", "phone", "address", "city", "state", "zip", "country", "currency_code", "*employees", "*orders", ];
export const retrieveCompany = async (companyId: string) => { const headers = { ...(await getAuthHeaders()), } const next = { ...(await getCacheOptions("companies")), } const company = await sdk.client.fetch<StoreCompanyResponse>( `/store/companies/${companyId}`, { query: { fields: "+spending_limit_reset_frequency,*employees.customer,*invites,*orders", }, method: "GET", headers, next, } ) return company }
Does anyone have a working example of how to expand the companies endpoint to fetch an array of all orders that company placed?
The text was updated successfully, but these errors were encountered:
VariableVic
No branches or pull requests
I want to expand the
retrieveCompany()
method to attach an array of all orders as well.It should be extremely straight forward but I simply cannot get it to work.
When I add the
*orders
like below to fetch orders as well the validator on the server keeps complaining:error: Requested fields [orders] are not valid
I have added it to the validator though like so:
Does anyone have a working example of how to expand the companies endpoint to fetch an array of all orders that company placed?
The text was updated successfully, but these errors were encountered: