mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-12 13:26:45 +00:00
chore: lint
This commit is contained in:
parent
a75ee69b94
commit
fbf840d448
3 changed files with 3 additions and 5 deletions
|
|
@ -49,7 +49,7 @@ const handleRandomClick = async () => {
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
<button @click="handleRandomClick" class="btn btn-primary">Random</button>
|
<button class="btn btn-primary" @click="handleRandomClick">Random</button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ const {
|
||||||
} = id === "random" ? await useRecipeRandom() : await useRecipeById(Number(id));
|
} = id === "random" ? await useRecipeRandom() : await useRecipeById(Number(id));
|
||||||
|
|
||||||
if (error.value) {
|
if (error.value) {
|
||||||
let statusCode = 400;
|
|
||||||
if (error.value.message === "Recipe not found") {
|
if (error.value.message === "Recipe not found") {
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
|
|
@ -33,7 +32,7 @@ if (error.value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode,
|
statusCode: 400,
|
||||||
statusMessage: "Invalid recipe id",
|
statusMessage: "Invalid recipe id",
|
||||||
message: error.value.message,
|
message: error.value.message,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { initTRPC } from "@trpc/server";
|
import { initTRPC , TRPCError } from "@trpc/server";
|
||||||
import type { Context } from "~/server/trpc/context";
|
import type { Context } from "~/server/trpc/context";
|
||||||
import { TRPCError } from "@trpc/server";
|
|
||||||
// import { authMiddleware } from "~/server/trpc/middleware";
|
// import { authMiddleware } from "~/server/trpc/middleware";
|
||||||
|
|
||||||
const t = initTRPC.context<Context>().create();
|
const t = initTRPC.context<Context>().create();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue