mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: use subdomains for organizations
This commit is contained in:
parent
600bb96603
commit
fac6b57ab3
16 changed files with 57 additions and 60 deletions
|
|
@ -6,7 +6,7 @@ import { Title } from "../../components/UI/Elements/Styles/Title";
|
|||
import { deleteOrganizationFromBackend } from "@services/orgs";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import { getAPIUrl } from "@services/config";
|
||||
import { getAPIUrl, getUriWithOrg } from "@services/config";
|
||||
|
||||
const Organizations = () => {
|
||||
const { data : organizations , error } = useSWR(`${getAPIUrl()}orgs/user/page/1/limit/10`, swrFetcher)
|
||||
|
|
@ -32,7 +32,7 @@ const Organizations = () => {
|
|||
<div>
|
||||
{organizations.map((org: any) => (
|
||||
<div key={org.org_id}>
|
||||
<Link href={`/org/${org.slug}`}>
|
||||
<Link href={getUriWithOrg(org.slug,"/")}>
|
||||
<h3>{org.name}</h3>
|
||||
</Link>
|
||||
<button onClick={() => deleteOrganization(org.org_id)}>Delete</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue