mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 14:01:24 +00:00
chore: update subscription permission
This commit is contained in:
parent
60c440ae10
commit
e936bb6f15
@ -1,5 +1,5 @@
|
||||
import { Alert, Button, Divider, Link, Textarea } from "@mui/joy";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import Icon from "@/components/Icon";
|
||||
import SubscriptionFAQ from "@/components/SubscriptionFAQ";
|
||||
@ -16,17 +16,12 @@ const SubscriptionSetting: React.FC = () => {
|
||||
const isAdmin = currentUser.role === "ADMIN";
|
||||
const profile = workspaceStore.profile;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isAdmin) {
|
||||
window.location.href = "/";
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (!isAdmin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const handleUpdateLicenseKey = async () => {
|
||||
if (!isAdmin) {
|
||||
toast.error("Only admin can upload license key");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const { subscription } = await subscriptionServiceClient.updateSubscription({
|
||||
licenseKey,
|
||||
|
Loading…
x
Reference in New Issue
Block a user