Compare commits

...
@@ -184,20 +184,21 @@ export class OverseerrIntegration extends Integration implements ISearchableInte
public async approveRequestAsync(requestId: number): Promise<void> { public async approveRequestAsync(requestId: number): Promise<void> {
logger.info(`Approving media request id='${requestId}' integration='${this.integration.name}'`); logger.info(`Approving media request id='${requestId}' integration='${this.integration.name}'`);
await fetchWithTrustedCertificatesAsync(this.url(`/api/v1/request/${requestId}/approve`), { const response = await fetchWithTrustedCertificatesAsync(this.url(`/api/v1/request/${requestId}/approve`), {
method: "POST", method: "POST",
headers: { headers: {
"X-Api-Key": this.getSecretValue("apiKey"), "X-Api-Key": this.getSecretValue("apiKey"),
}, },
}).then((response) => { });
if (!response.ok) { if (!response.ok) {
const content = await response.text();
logger.error( logger.error(
`Failed to approve media request id='${requestId}' integration='${this.integration.name}' reason='${response.status} ${response.statusText}' url='${response.url}'`, `Failed to approve media request id='${requestId}' integration='${this.integration.name}' reason='${response.status} ${response.statusText}' url='${response.url}' content='${content}'`,
); );
} }
logger.info(`Successfully approved media request id='${requestId}' integration='${this.integration.name}'`); logger.info(`Successfully approved media request id='${requestId}' integration='${this.integration.name}'`);
});
} }
public async declineRequestAsync(requestId: number): Promise<void> { public async declineRequestAsync(requestId: number): Promise<void> {