//native
/**
* Retrieve a Paginated List of Shift Rates
* Retrieve a paginated list of shift rates, including details such as rate name, type, value, and timestamps. Pagination parameters can be used to control the size and position of the result set.
**Token scopes**: `time-tracking:read`
*/
export async function main(auth: RT.Deel, limit?: string | undefined, offset?: string | undefined) {
const url = new URL(`https://api.letsdeel.com/rest/v2/time_tracking/shift_rates`)
for (const [k, v] of [
['limit', limit],
['offset', offset]
]) {
if (v !== undefined && v !== '') {
url.searchParams.append(k, v)
}
}
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago