Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/api/public/transcripts/[guild]/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME } from "@/components/unity/team-switcher"
import { BASE_URI, USE_HTTPS } from "@/lib/definitions"
import { NextResponse } from "next/server"


async function GetTranscript( req: Request,
{ params } : { params: Promise<{id: string, guild: string}> }
) {

const { id, guild } = (await params)

const response = NextResponse.redirect(`http${USE_HTTPS? 's': ''}://${BASE_URI}/dashboard/transcripts/${id}`)

response.cookies.set({
name: SIDEBAR_COOKIE_NAME,
value: guild,
maxAge: SIDEBAR_COOKIE_MAX_AGE,
httpOnly: true,
sameSite: "strict",
});

return response

}


export {
GetTranscript as GET
}
4 changes: 2 additions & 2 deletions components/unity/team-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { useBackend } from "@/hooks/use-backend"
import { useSelectedGuildState } from "@/hooks/use-selected-guild-state"
import { useSearchParams } from "next/navigation"

const SIDEBAR_COOKIE_NAME = "sidebar-guild"
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
export const SIDEBAR_COOKIE_NAME = "sidebar-guild"
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 30

export function TeamSwitcher({
teams,
Expand Down