Skip to content

Commit

Permalink
move org.png route over
Browse files Browse the repository at this point in the history
  • Loading branch information
jewlexx committed Nov 9, 2024
1 parent d1b6445 commit f42ce07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
Empty file removed src-old/lib/icon.server.ts
Empty file.
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { json, type RequestHandler } from '@sveltejs/kit';
import { fetchIconUrl } from '$/lib/icons/org';

import { fetchIconUrl } from '$lib/icons/org.server';

export const GET: RequestHandler = async function () {
export async function GET (): Promise<Response> {
try {
const iconUrl = await fetchIconUrl();

if (!iconUrl) {
return json(
{
error: 'No icon found'
},
{
status: 404
}
);
if (!iconUrl) {
return Response.json({
error: 'No icon found'
},
{
status: 404
}

);
}

try {
Expand Down Expand Up @@ -44,7 +42,7 @@ export const GET: RequestHandler = async function () {

// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (_e) {
return json(
return Response.json(
{
error: 'Failed to fetch icon'
},
Expand All @@ -54,11 +52,11 @@ export const GET: RequestHandler = async function () {
);
}

return json({
return Response.json({
iconUrl
});
} catch (error: unknown) {
return json(
return Response.json(
{
error: error
},
Expand Down
File renamed without changes.

0 comments on commit f42ce07

Please sign in to comment.