Edits history of script submission #18401 for ' List alert receivers (qovery)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * List alert receivers
     * Retrieve all alert receivers for a specific organization
     */
    export async function main(auth: RT.Qovery, organizationId: string) {
    	const url = new URL(`https://api.qovery.com/api/organization/${organizationId}/alert-receivers`)
    
    	const response = await fetch(url, {
    		method: 'GET',
    		headers: {
    			Authorization: 'Token ' + 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