format: run prettier

This commit is contained in:
Reinaldy Rafli 2022-09-10 20:33:58 +07:00
parent 151bbd3b31
commit 1b6a68a036
No known key found for this signature in database
GPG Key ID: EA1B2522C1693EC8
8 changed files with 25 additions and 28 deletions

View File

@ -1,7 +1,7 @@
import type { Handle } from "@sveltejs/kit"; import type { Handle } from '@sveltejs/kit';
export const handle: Handle = ({ event, resolve }) => { export const handle: Handle = ({ event, resolve }) => {
return resolve(event, { return resolve(event, {
transformPageChunk: ({ html }) => html.replace('%lang%', "en") transformPageChunk: ({ html }) => html.replace('%lang%', 'en'),
}); });
} };

View File

@ -108,4 +108,4 @@
"3": "Do some error handling if the request fails" "3": "Do some error handling if the request fails"
} }
} }
} }

View File

@ -108,4 +108,4 @@
"3": "Periksa dan jangan abaikan errornya jika request gagal" "3": "Periksa dan jangan abaikan errornya jika request gagal"
} }
} }
} }

View File

@ -1,21 +1,19 @@
import { $fetch } from "ohmyfetch"; import { $fetch } from 'ohmyfetch';
import env from "../lib/env"; import env from '../lib/env';
interface TotalResponse { interface TotalResponse {
message: number; message: number;
} }
/** @type {import('./$types').PageServerLoad} */ /** @type {import('./$types').PageServerLoad} */
export async function load() { export async function load() {
const response = await $fetch<TotalResponse>( const response = await $fetch<TotalResponse>('total', {
"total", method: 'GET',
{ baseURL: env.API_ENDPOINT,
method: "GET", parseResponse: JSON.parse,
baseURL: env.API_ENDPOINT, });
parseResponse: JSON.parse
});
return { return {
total: response.message total: response.message,
} };
} }

View File

@ -1 +1 @@
export const ssr = true; export const ssr = true;

View File

@ -22,12 +22,12 @@ const config = {
assets: './static', assets: './static',
hooks: { hooks: {
server: './src', server: './src',
client: './src' client: './src',
}, },
lib: './src/lib', lib: './src/lib',
}, },
adapter: adapter({ adapter: adapter({
out: "dist" out: 'dist',
}), }),
}, },
}; };

View File

@ -24,8 +24,8 @@
"allowJs": true, "allowJs": true,
"checkJs": true, "checkJs": true,
"paths": { "paths": {
"$lib":["src/lib"], "$lib": ["src/lib"],
"$lib/*":["src/lib/*"] "$lib/*": ["src/lib/*"]
} }
}, },
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"] "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]

View File

@ -2,6 +2,5 @@ import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
export default defineConfig({ export default defineConfig({
plugins: [sveltekit()], plugins: [sveltekit()],
}); });