//native
type Miro = {
token: string;
};
/**
* Get all legal holds within a case
* Retrieves the list of all legal holds within a case for an organization.Required scope organization:cases:management Rate limiting Level 4 Enterprise Guard only This API is available only for Enterprise plan users with the Enterprise Guard add-on. You can only use this endpoint if you have both the Company Admin and eDiscovery Admin roles.
*/
export async function main(
auth: Miro,
org_id: string,
case_id: string,
limit: string | undefined,
cursor: string | undefined,
) {
const url = new URL(
`https://api.miro.com//v2/orgs/${org_id}/cases/${case_id}/legal-holds`,
);
for (const [k, v] of [
["limit", limit],
["cursor", cursor],
]) {
if (v !== undefined && v !== "" && k !== undefined) {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
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