Merge branch 'dev' into feature/profilePage

This commit is contained in:
Lucas Oliveira 2023-09-05 11:18:29 -03:00
commit 8119d5922b
60 changed files with 240 additions and 139 deletions

View file

@ -149,16 +149,21 @@ export default function Header(): JSX.Element {
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
{isAdmin && (
<DropdownMenuItem onClick={() => navigate("/admin")}>
<DropdownMenuItem
className="cursor-pointer"
onClick={() => navigate("/admin")}
>
Admin Page
</DropdownMenuItem>
)}
<DropdownMenuItem
className="cursor-pointer"
onClick={() => navigate("/account/settings")}
>
Profile Settings
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"
onClick={() => {
logout();
navigate("/login");

View file

@ -54,7 +54,7 @@ export default function InputComponent({
</Form.Control>
) : (
<Input
type={password && !pwdVisible ? "password" : "text"}
type="text"
value={value}
disabled={disabled}
required={required}

View file

@ -471,7 +471,7 @@ export async function updateUser(user_id: string, user: Users) {
export async function getApiKey() {
try {
const res = await api.get(`${BASE_URL_API}api_key`);
const res = await api.get(`${BASE_URL_API}api_key/`);
if (res.status === 200) {
return res.data;
}
@ -483,7 +483,7 @@ export async function getApiKey() {
export async function createApiKey(name: string) {
try {
const res = await api.post(`${BASE_URL_API}api_key`, { name });
const res = await api.post(`${BASE_URL_API}api_key/`, { name });
if (res.status === 200) {
return res.data;
}

View file

@ -32,8 +32,8 @@ export default function LoginPage(): JSX.Element {
function signIn() {
const user: LoginType = {
username: username,
password: password,
username: username.trim(),
password: password.trim(),
};
onLogin(user)
.then((user) => {

View file

@ -33,8 +33,8 @@ export default function SignUp(): JSX.Element {
function handleSignup(): void {
const { username, password } = inputState;
const newUser: UserInputType = {
username,
password,
username: username.trim(),
password: password.trim(),
};
addUser(newUser)
.then((user) => {