mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-03 17:14:03 +00:00 
			
		
		
		
	Can create text posts
This commit is contained in:
		@@ -34,4 +34,5 @@ pub mod post_api;
 | 
			
		||||
pub mod movie_api;
 | 
			
		||||
pub mod survey_choice_api;
 | 
			
		||||
pub mod survey_api;
 | 
			
		||||
pub mod comment_api;
 | 
			
		||||
pub mod comment_api;
 | 
			
		||||
pub mod res_create_post;
 | 
			
		||||
							
								
								
									
										21
									
								
								src/api_data/res_create_post.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/api_data/res_create_post.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
//! # Create a post result
 | 
			
		||||
//!
 | 
			
		||||
//! @author Pierre Hubert
 | 
			
		||||
use serde::Serialize;
 | 
			
		||||
 | 
			
		||||
#[derive(Serialize)]
 | 
			
		||||
#[allow(non_snake_case)]
 | 
			
		||||
pub struct ResCreatePost {
 | 
			
		||||
    success: String,
 | 
			
		||||
    postID: u64,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl ResCreatePost {
 | 
			
		||||
    /// Initialize a new structure
 | 
			
		||||
    pub fn new(post_id: u64) -> ResCreatePost {
 | 
			
		||||
        ResCreatePost {
 | 
			
		||||
            success: "The post has been created!".to_string(),
 | 
			
		||||
            postID: post_id,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user