Skip to content

Commit

Permalink
fix(provider): issue related to string coming empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-arc10 committed Dec 10, 2024
1 parent 11c3906 commit b2f9482
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/provider-console/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ const SettingsPage: React.FC = () => {
const [isRestartLoading, setIsRestartLoading] = useState(false);
const [showSuccess, setShowSuccess] = useState(false);

// Assume these are your API functions
const { providerDetails } = useProvider();
const { activeControlMachine } = useControlMachine();

const handleUrlUpdate = () => {
try {
urlSchema.parse(url);

// call api here
// TODO: call update provider url api here
setUrlError("");
} catch (error) {
setUrlError("Please enter a valid URL");
}
};

const restartProvider = async () => {
// call api here
try {
setIsRestartLoading(true);
const request = {
Expand All @@ -55,7 +53,7 @@ const SettingsPage: React.FC = () => {
};

const upgradeProvider = () => {
// call api here
// TODO: call upgrade provider api here
};

if (!activeControlMachine) {
Expand Down Expand Up @@ -97,7 +95,7 @@ const SettingsPage: React.FC = () => {
<p className="mt-2 text-gray-600">Update the URL for your provider service.</p>
<div className="mt-4 flex gap-4">
<Input
value={url || stripProviderPrefixAndPort(providerDetails?.hostUri)}
value={url || stripProviderPrefixAndPort(providerDetails?.hostUri || "")}
onChange={e => setUrl(e.target.value)}
placeholder={"Enter new URL"}
error={urlError ? true : undefined}
Expand Down

0 comments on commit b2f9482

Please sign in to comment.