Skip to content

Commit

Permalink
Fix: user role options
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Sep 15, 2024
1 parent 2ce4766 commit c755af6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/components/users/dialog.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from "react";
import { useSelector } from "react-redux";
import { userRoleOptions } from "@/filters";
import { store } from "@/store";
import { useAddUserMutation } from "@/store/api";
import { toggleAddUserDialog } from "@/store/reducers/ui/user";
Expand Down Expand Up @@ -57,10 +58,7 @@ const UserDialog = ({ refresh }) => {
className="sm:h-14"
label="Select Role"
name="role"
options={[
{ key: "Admin", label: "ADMIN" },
{ key: "Spectator", label: "SPECTATOR" }
]}
options={userRoleOptions}
value={role}
onChange={(e) => setRole(e.target.value)}
/>
Expand Down
26 changes: 16 additions & 10 deletions src/filters/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import { activeFilters } from "./common";

export const userRoleOptions = [
{
key: "GROUP",
label: "Team"
},
{
key: "ADMIN",
label: "Admin"
},
{
key: "SPECTATOR",
label: "Spectator"
}
];

export const userFilters = [
{
key: "name",
Expand Down Expand Up @@ -43,15 +58,6 @@ export const userFilters = [
{
key: "role",
label: "Role",
options: [
{
key: "GROUP",
label: "Team"
},
{
key: "ADMIN",
label: "Admin"
}
]
options: userRoleOptions
}
];

0 comments on commit c755af6

Please sign in to comment.