Skip to content

Commit

Permalink
remove: boilerplate routes for tbconsumer wild goose hunt
Browse files Browse the repository at this point in the history
  • Loading branch information
matyson committed May 22, 2024
1 parent ecea0db commit c0cbb6a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 55 deletions.
23 changes: 0 additions & 23 deletions apps/deepsirius-ui/src/components/hello.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/deepsirius-ui/src/pages/hello.tsx

This file was deleted.

24 changes: 1 addition & 23 deletions apps/deepsirius-ui/src/server/api/routers/tb_consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,17 @@ export const tbConsumerRouter = createTRPCRouter({
.object({
status: z.string(),
message: z.string(),

})
.parse(data);

throw new TRPCError({
code: 'INTERNAL_SERVER_ERROR',
message: error.message,
cause: data,
cause: data,
});
}
const parsed = TensorboardResponseSchema.parse(data);

return parsed;
}),
hello: protectedProcedure.query(async () => {
const url = `${env.TENSORBOARD_API_URL}/api/`;
try {
const res = await fetch(url, {
method: 'GET',
headers: {
'x-api-key': env.TENSORBOARD_API_KEY,
},
});

const data: unknown = await res.json();
return data;
} catch (e) {
console.log('OLHA ESSE ERRO PLMDDS', e);
throw new TRPCError({
code: 'INTERNAL_SERVER_ERROR',
message: 'Failed to fetch Tensorboard API',
cause: e,
});
}
}),
});

0 comments on commit c0cbb6a

Please sign in to comment.