Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align save collection call with overall project architecture #115

Open
n14s opened this issue Dec 2, 2023 · 1 comment
Open

Align save collection call with overall project architecture #115

n14s opened this issue Dec 2, 2023 · 1 comment

Comments

@n14s
Copy link
Contributor

n14s commented Dec 2, 2023

The common approach for api call from the frontend in this project is, that they are defined in the api/index and passed from the Dashboard.tsx to the components.
The save collection call in the the collection panel is not doing that.

const handleSaveCollection = async () => {
try {
const response = await fetch(BASE_PATH + 'api/collection', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(currentCollection),
});
if (response.status !== 200) throw new Error();

@jonrosner
Copy link
Contributor

We'll have to consider how to structure the project best when we want to introduce the command palette. Basically all "actions" a user can take (like clicking a button) will have to be defined way up in the hierarchy in some kind of "command" component. This will also include the save collection action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants