export type DeleteApiV2CompanyCompanyIdLogBookPostsIdArgs = {'x-api-version'?: string | undefined, 'x-company-guid'?: string | undefined, company_id: number, id: number}; export type DeleteApiV2CompanyCompanyIdLogBookPostsIdOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Log Book Post * * DELETE /v2/company/{company_id}/log_book_posts/{id} * * Also accepts auth: cookieAuth */ export const deleteApiV2CompanyCompanyIdLogBookPostsId = async (args: DeleteApiV2CompanyCompanyIdLogBookPostsIdArgs, options?: DeleteApiV2CompanyCompanyIdLogBookPostsIdOptions) => { const {baseUrl = "https://api.7shifts.com", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-version'] != null) headers.set("x-api-version", String(args['x-api-version'])) if (args['x-company-guid'] != null) headers.set("x-company-guid", String(args['x-company-guid'])) if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/company/${encodeURIComponent(String(args.company_id))}/log_book_posts/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };