feat: only show edit button when logged in
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { BadRequestError } from "@lib/errors.ts";
|
||||
import { AccessDeniedError, BadRequestError } from "@lib/errors.ts";
|
||||
import { getTypeSenseClient } from "@lib/typesense.ts";
|
||||
import { json } from "@lib/helpers.ts";
|
||||
import { extractHashTags } from "@lib/string.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(req, _ctx) {
|
||||
async GET(req, ctx) {
|
||||
const session = ctx.state.session;
|
||||
if (!session) {
|
||||
throw new AccessDeniedError();
|
||||
}
|
||||
|
||||
const url = new URL(req.url);
|
||||
let query = url.searchParams.get("q");
|
||||
if (!query) {
|
||||
|
Reference in New Issue
Block a user