Skip to content

Commit

Permalink
error on creating more than 3 clients
Browse files Browse the repository at this point in the history
  • Loading branch information
devsisingh committed Jan 24, 2024
1 parent dacb83f commit b6a25ab
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions pages/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,19 @@ const Subscription = () => {
setConfigFile(configFile);
setverify(true);
setValueFromChild2("refreshafterclientcreate");
} else {
setMsg("error");
} else if(response.status === 400){
setMsg("Cant create more than 3 clients");
}
// }
} catch (error) {
console.error("Error:", error);
setMsg("error");
} finally {
setLoading(false);
}
else{
setMsg("Failed to create VPN. Try with unique name.");
}
// }
} catch (error) {
console.error("Error:", error);
setMsg("Failed to create VPN. Try with unique name.");
} finally {
setLoading(false);
}
};

useEffect(() => {
Expand Down Expand Up @@ -1004,15 +1007,15 @@ const Subscription = () => {
</div>
</div>
)}
{msg == "success" && (
{/* {msg == "success" && (
<p className="text-green-500">Successful</p>
)}
)} */}

{msg == "error" && (
{/* {msg == "error" && ( */}
<p className="text-red-500">
Failed to create VPN. Enter unique name.
{msg}
</p>
)}
{/* )} */}
</div>
</div>
</section>
Expand Down

0 comments on commit b6a25ab

Please sign in to comment.