Skip to content

Commit

Permalink
model schema fixes (#178)
Browse files Browse the repository at this point in the history
* model schema fixes

* fix annoying pattern
  • Loading branch information
codekansas authored Jul 25, 2024
1 parent 359fc22 commit 3077112
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 330 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ docker run -d --name localstack -p 4566:4566 -p 4571:4571 localstack/localstack
Then, if you need to kill the database, you can run:

```bash
docker kill store-db || true
docker rm store-db || true
docker kill localstack || true
docker rm localstack || true
```

Initialize the test databases by running the creation script:
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const App = () => {
<Route path="/parts/:page" element={<Parts />} />
<Route path="/part/:id" element={<PartDetails />} />
<Route path="/part/edit/:id" element={<EditPartForm />} />
<Route path="/robots/my/:page" element={<MyRobots />} />
<Route path="/parts/my/:page" element={<MyParts />} />
<Route path="/robots/me/:page" element={<MyRobots />} />
<Route path="/parts/me/:page" element={<MyParts />} />
<Route path="/404" element={<NotFound />} />
<Route path="*" element={<NotFoundRedirect />} />
</Routes>
Expand Down
27 changes: 2 additions & 25 deletions frontend/src/components/nav/TopNavbar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Boop from "components/nav/Boop";
import Sidebar from "components/nav/Sidebar";
import { api } from "hooks/api";
import { setLocalStorageAuth, useAuthentication } from "hooks/auth";
import { useAuthentication } from "hooks/auth";
import { useTheme } from "hooks/theme";
import { useEffect, useState } from "react";
import { useState } from "react";
import { Container, Nav, Navbar } from "react-bootstrap";
import { GearFill, MoonFill, SunFill } from "react-bootstrap-icons";
import { Link } from "react-router-dom";
Expand All @@ -12,28 +11,6 @@ const TopNavbar = () => {
const [showSidebar, setShowSidebar] = useState<boolean>(false);
const { theme, setTheme } = useTheme();
const auth = useAuthentication();
const auth_api = new api(auth.api);

useEffect(() => {
(async () => {
try {
// Get the code from the query string to carry out OAuth login.
const search = window.location.search;
const params = new URLSearchParams(search);
const code = params.get("code");
if (auth.isAuthenticated) {
const { email } = await auth_api.me();
auth.setEmail(email);
} else if (code) {
const res = await auth_api.loginGithub(code as string);
setLocalStorageAuth(res.api_key_id);
auth.setIsAuthenticated(true);
}
} catch (error) {
console.error(error);
}
})();
}, []);

return (
<>
Expand Down
Loading

0 comments on commit 3077112

Please sign in to comment.