From 394e8ed888e70ec3b0abb6bec5461ddaaaf2392b Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Sat, 7 Dec 2024 16:00:21 +0100 Subject: [PATCH] formatting --- .../[id=uuid]/export/word/+server.ts | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/export/word/+server.ts b/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/export/word/+server.ts index 1a32f73d3..bc22d83cb 100644 --- a/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/export/word/+server.ts +++ b/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/export/word/+server.ts @@ -1,23 +1,22 @@ - import { BASE_API_URL } from '$lib/utils/constants'; import { error } from '@sveltejs/kit'; import type { RequestHandler } from './$types'; export const GET: RequestHandler = async ({ fetch, params }) => { - const URLModel = 'compliance-assessments'; - const endpoint = `${BASE_API_URL}/${URLModel}/${params.id}/word_report/`; + const URLModel = 'compliance-assessments'; + const endpoint = `${BASE_API_URL}/${URLModel}/${params.id}/word_report/`; - const res = await fetch(endpoint); - if (!res.ok) { - error(400, 'Error fetching the Word file'); - } + const res = await fetch(endpoint); + if (!res.ok) { + error(400, 'Error fetching the Word file'); + } - const fileName = `audit-report-${new Date().toISOString()}.docx`; + const fileName = `audit-report-${new Date().toISOString()}.docx`; - return new Response(await res.blob(), { - headers: { - 'Content-Type': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'Content-Disposition': `attachment; filename="${fileName}"` - } - }); + return new Response(await res.blob(), { + headers: { + 'Content-Type': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'Content-Disposition': `attachment; filename="${fileName}"` + } + }); };