a mini social media app for small communities
at main 358 B view raw
1module entity 2 3// SavedPost represents a saved post for a given user 4pub struct SavedPost { 5pub mut: 6 id int @[primary; sql: serial] 7 post_id int 8 user_id int 9 saved bool 10 later bool 11} 12 13// can_remove returns true if the SavedPost is neither saved or saved for later. 14pub fn (post &SavedPost) can_remove() bool { 15 return !post.saved && !post.later 16}