hezarfen_backend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! Note workflows: the create/read/list/update/delete paths the notes |
| 2 | //! surface drives, all scoped to the owning user. The queries live in |
| 3 | //! [`crate::db::note`]; blob unlinking stays in the web layer. |
| 4 | |
| 5 | use crateDatabase; |
| 6 | use cratenote; |
| 7 | use crate; |
| 8 | use crateNoteFile; |
| 9 | use crateUserId; |
| 10 | use crateAppError; |
| 11 | |
| 12 | pub async |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | /// Read a note only if it belongs to `owner`. |
| 22 | pub async |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | pub async |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | /// Only what the request carried is written: an omitted field (`None`) is |
| 40 | /// not stored at all, so a concurrent edit of the other field survives. |
| 41 | pub async |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | /// Delete the note and cascade its attachment rows; the returned files are |
| 51 | /// exactly whose blobs the caller may unlink. |
| 52 | pub async |
| 53 | |
| 54 |