mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 09:34:04 +00:00 
			
		
		
		
	Can get the list of movies of current user
This commit is contained in:
		@@ -5,8 +5,17 @@
 | 
			
		||||
use crate::constants::database_tables_names::MOVIES_TABLE;
 | 
			
		||||
use crate::data::error::ResultBoxError;
 | 
			
		||||
use crate::data::movie::Movie;
 | 
			
		||||
use crate::data::user::UserID;
 | 
			
		||||
use crate::helpers::database;
 | 
			
		||||
 | 
			
		||||
/// Get the list of movies of the current
 | 
			
		||||
pub fn get_list_user(user_id: &UserID) -> ResultBoxError<Vec<Movie>> {
 | 
			
		||||
    database::QueryInfo::new(MOVIES_TABLE)
 | 
			
		||||
        .cond_user_id("ID_user", user_id)
 | 
			
		||||
        .set_order("ID DESC")
 | 
			
		||||
        .exec(db_to_movie)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Get information about a single movie
 | 
			
		||||
pub fn get_info(movie_id: u64) -> ResultBoxError<Movie> {
 | 
			
		||||
    database::QueryInfo::new(MOVIES_TABLE)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user