add: full links api
This commit is contained in:
parent
c2dbe2f114
commit
ffdb767518
12 changed files with 532 additions and 4 deletions
|
@ -597,6 +597,18 @@ pub fn routes() -> Router {
|
|||
// uploads
|
||||
.route("/uploads/{id}", get(uploads::get_request))
|
||||
.route("/uploads/{id}", delete(uploads::delete_request))
|
||||
// links
|
||||
.route("/links", get(auth::links::list_request))
|
||||
.route("/links", post(auth::links::create_request))
|
||||
.route("/links/{id}", get(auth::links::get_request))
|
||||
.route("/links/{id}", delete(auth::links::delete_request))
|
||||
.route("/links/icon", post(auth::links::upload_icon_request))
|
||||
.route("/links/{id}/label", post(auth::links::update_label_request))
|
||||
.route("/links/{id}/href", post(auth::links::update_href_request))
|
||||
.route(
|
||||
"/links/{id}/position",
|
||||
post(auth::links::update_position_request),
|
||||
)
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
@ -970,3 +982,29 @@ pub struct RemoveJournalDir {
|
|||
pub struct UpdateNoteTags {
|
||||
pub tags: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreateLink {
|
||||
pub label: String,
|
||||
pub href: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateLinkLabel {
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateLinkHref {
|
||||
pub href: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateLinkPosition {
|
||||
pub position: i32,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UploadLinkIcon {
|
||||
pub id: String,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue