23 lines
501 B
TypeScript
23 lines
501 B
TypeScript
"use server";
|
|
import { fetchDataWithToken } from "./api-fetcher";
|
|
import { baseUrl } from "./basics";
|
|
|
|
const accessAvailableEndpoint = `${baseUrl}/access/endpoint/available`;
|
|
|
|
async function retrieveAvailableEndpoint(payload: string) {
|
|
const tokenResponse: any = await fetchDataWithToken(
|
|
accessAvailableEndpoint,
|
|
{
|
|
endpoint: payload,
|
|
},
|
|
"POST",
|
|
false
|
|
);
|
|
if (tokenResponse.status === 200) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
export { retrieveAvailableEndpoint };
|