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

Implement ApiClient for all endpoints #18

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Conversation

mads256h
Copy link
Member

@mads256h mads256h commented Apr 4, 2024

Change delete endpoints to only take the id of the object to delete. Change delete endpoints to use the HTTP DELETE method.

Add protocol objects to the frontend for talking to the backend. Use kotlin coroutines instead of callbacks for the ApiClient.

Create tests that connect to http://localhost:3000 and tests with the backend.

@mads256h mads256h force-pushed the frontend-backend-test branch 7 times, most recently from f55ff3a to 3a6ccc4 Compare April 4, 2024 15:32
Change delete endpoints to only take the id of the object to delete.
Change delete endpoints to use the HTTP DELETE method.

Add protocol objects to the frontend for talking to the backend.
Use kotlin coroutines instead of callbacks for the ApiClient.

Create tests that connect to http://localhost:3000 and tests with the
backend.
Copy link
Contributor

@Mikkel-Boje Mikkel-Boje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axum is amazing 😄


#[derive(Deserialize, Serialize)]
pub struct DeleteDeviceRequest {
pub id: i64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the device' id?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it matches the name in the device struct


#[derive(Deserialize, Serialize)]
pub struct DeleteTaskRequest {
pub id: i64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the tasks' id?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it matches the name in the task struct

@mads256h mads256h merged commit df47303 into master Apr 5, 2024
2 checks passed
@mads256h mads256h deleted the frontend-backend-test branch April 5, 2024 07:29
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

Successfully merging this pull request may close these issues.

4 participants