diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 280b580164..b915f14fd1 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -1,7 +1,9 @@ +import { notificationStore } from "../store" +import { ApiVersion } from "../constants" + /** * API cache for cached request responses. */ -import { notificationStore } from "../store" let cache = {} /** @@ -22,6 +24,7 @@ const makeApiCall = async ({ method, url, body, json = true }) => { const headers = { Accept: "application/json", "x-budibase-app-id": window["##BUDIBASE_APP_ID##"], + "x-budibase-api-version": ApiVersion, ...(json && { "Content-Type": "application/json" }), ...(!inBuilder && { "x-budibase-type": "client" }), } diff --git a/packages/client/src/constants.js b/packages/client/src/constants.js index 31ac4b285e..e0595c0ce9 100644 --- a/packages/client/src/constants.js +++ b/packages/client/src/constants.js @@ -7,3 +7,11 @@ export const ActionTypes = { RefreshDatasource: "RefreshDatasource", SetDataProviderQuery: "SetDataProviderQuery", } + +export const ApiVersion = "1" + +/** + * API Version Changelog + * v1: + * - Coerce types for search endpoint + */