refactor(server/utils): create utility to return forum database's uid using the actual site's user id
This commit is contained in:
parent
97d3f86c5a
commit
490fa1469e
16
lib/server/forumId.ts
Normal file
16
lib/server/forumId.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { H3Event, EventHandlerRequest } from "h3";
|
||||
import { apiRoot } from "./constants";
|
||||
export default async function (id: number): Promise<number> {
|
||||
let { data: lookup } = await useFetch<any>(
|
||||
`${apiRoot}/session-sharing/lookup`,
|
||||
{
|
||||
method: "get",
|
||||
query: {
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
return lookup.value.uid as number;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user