mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
adding cookie storage for current organization.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
'use server';
|
||||
|
||||
import {cookies} from 'next/headers';
|
||||
|
||||
|
||||
const COOKIE_NAME = 'PORTABASE_ORGANIZATION_SLUG';
|
||||
|
||||
export async function getCurrentOrganizationSlug() {
|
||||
return (await cookies()).get(COOKIE_NAME)?.value || "default";
|
||||
}
|
||||
|
||||
export async function setCurrentOrganizationSlug(slug: string) {
|
||||
return (await cookies()).set(COOKIE_NAME, slug).get(COOKIE_NAME)?.value;
|
||||
}
|
||||
Reference in New Issue
Block a user