Skip to content

Creating custom object in custom application #3144

Answered by kark
nikhilkni asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @nikhilkni,

Kindly try this snippet and let us know if it works for you.

const fetcher = async (url, config = {}) => {
  let headers;
  const data = await executeHttpClientRequest(
    async (options) => {
      headers = { ...options.headers, ...config.headers };
      const res = await fetch(buildApiUrl(url), { ...config, headers });
      const data = res.json();
      return {
        data,
        statusCode: res.status,
        getHeader: (key) => res.headers.get(key),
      };
    },
    { headers }
  );
  return data;
};

export const createCustomObject = async () => {
  try {
    const customObject = await fetcher(`/${projectKey}/custom-objects`, {
      method: 'POST',
      h…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@nikhilkni
Comment options

Comment options

You must be logged in to vote
1 reply
@nikhilkni
Comment options

Answer selected by nikhilkni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants