Edits history of script submission #14228 for ' Updates a table row. (bamboo_hr)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Updates a table row.
     * Updates a table row. Fundamentally the same as version 1 so choose a version and stay with it unless other changes occur. Changes from version 1 are now minor with a few variations limited to ACA, payroll, terminated rehire, gusto, benetrac, and final pay date.
     */
    export async function main(
    	auth: RT.BambooHr,
    	id: string,
    	table: string,
    	rowId: string,
    	body: TableRowUpdate
    ) {
    	const url = new URL(
    		`https://${auth.companyDomain}.bamboohr.com/api/v1_1/employees/${id}/tables/${table}/${rowId}`
    	)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			'Content-Type': 'application/json',
    			Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
    		},
    		body: JSON.stringify(body)
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.text()
    }
    
    /* eslint-disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    
    export interface TableRowUpdate {
    	date?: string
    	location?: string
    	division?: string
    	department?: string
    	jobTitle?: string
    	reportsTo?: string
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago