mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-08-03 23:11:28 +02:00
Load shopping list from server on app startup
This commit is contained in:
Generated
-1607
File diff suppressed because it is too large
Load Diff
@@ -7,3 +7,4 @@ edition = "2021"
|
||||
rocket = { version = "0.5.1", features = ["json"] }
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = "1.0.145"
|
||||
inkopslista-lib = { path = "../inkopslista-lib" }
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
use std::{ops::Deref, sync::Mutex};
|
||||
use std::sync::Mutex;
|
||||
|
||||
use inkopslista_lib::{Item, ItemData};
|
||||
use rocket::{serde::json::Json, State};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -59,15 +60,3 @@ fn rocket() -> _ {
|
||||
struct MockDb {
|
||||
pub list: Vec<Item>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
|
||||
struct Item {
|
||||
pub name: String,
|
||||
pub data: ItemData,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
|
||||
|
||||
struct ItemData {
|
||||
pub checked: bool,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user