Skip to content

Commit

Permalink
Refactor updateUserPasswordApi to use query parameters for user ID; a…
Browse files Browse the repository at this point in the history
…dd Radix UI progress component for enhanced loading indicators
  • Loading branch information
danielmarv committed Feb 2, 2025
1 parent c0f547d commit 71ff5a8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
28 changes: 28 additions & 0 deletions netmanager-app/components/ui/progress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client"

import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress"

import { cn } from "@/lib/utils"

const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, ...props }, ref) => (
<ProgressPrimitive.Root
ref={ref}
className={cn(
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
className
)}
{...props}
>
<ProgressPrimitive.Indicator
className="h-full w-full flex-1 bg-primary transition-all"
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
))
Progress.displayName = ProgressPrimitive.Root.displayName

export { Progress }
4 changes: 3 additions & 1 deletion netmanager-app/core/apis/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export const updateUserPasswordApi = async (
userId: string,
userData: PasswordData
): Promise<PasswordData> => {
return await axiosInstance.put(`${USERS_MGT_URL}/updatePassword/${userId}`, userData)
return await axiosInstance.put(`${USERS_MGT_URL}/updatePassword`, userData, {
params: { id: userId },
})
.then((response) => response.data);
};

Expand Down
24 changes: 24 additions & 0 deletions netmanager-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions netmanager-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-popover": "^1.1.4",
"@radix-ui/react-progress": "^1.1.1",
"@radix-ui/react-select": "^2.1.4",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.2",
Expand Down

0 comments on commit 71ff5a8

Please sign in to comment.