mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 12:40:09 +01:00
f48e6b1a3e
* chore: add @ as alias for frontend root * fix: remove bad tag
28 lines
704 B
JavaScript
28 lines
704 B
JavaScript
import { API_BASE } from "@/utils/constants";
|
|
|
|
const Invite = {
|
|
checkInvite: async (inviteCode) => {
|
|
return await fetch(`${API_BASE}/invite/${inviteCode}`, {
|
|
method: "GET",
|
|
})
|
|
.then((res) => res.json())
|
|
.catch((e) => {
|
|
console.error(e);
|
|
return { invite: null, error: e.message };
|
|
});
|
|
},
|
|
acceptInvite: async (inviteCode, newUserInfo = {}) => {
|
|
return await fetch(`${API_BASE}/invite/${inviteCode}`, {
|
|
method: "POST",
|
|
body: JSON.stringify(newUserInfo),
|
|
})
|
|
.then((res) => res.json())
|
|
.catch((e) => {
|
|
console.error(e);
|
|
return { success: false, error: e.message };
|
|
});
|
|
},
|
|
};
|
|
|
|
export default Invite;
|