Edits history of script submission #9275 for ' Delete Learning Review (motimate)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Motimate = {
    	token: string
    }
    
    export async function main(auth: Motimate, learning_review_id: string) {
    	const url = new URL(`https://motimateapp.com/public_api/learning_reviews/${learning_review_id}`)
    
    	const response = await fetch(url, {
    		method: 'DELETE',
    		headers: {
    			Authorization: 'Bearer ' + auth.token
    		}
    	})
    
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    
    	return await response.text()
    }
    

    Submitted by hugo697 581 days ago