mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-03 11:04:02 +00:00 
			
		
		
		
	Can change post visibility level
This commit is contained in:
		@@ -442,6 +442,24 @@ export class PostsHelper {
 | 
			
		||||
		}) > 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Set new visibility level to the post
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param postID Target post ID
 | 
			
		||||
	 * @param level Target access level
 | 
			
		||||
	 */
 | 
			
		||||
	public static async SetLevel(postID: number, level: PostVisibilityLevel) {
 | 
			
		||||
		await DatabaseHelper.UpdateRows({
 | 
			
		||||
			table: TABLE_NAME,
 | 
			
		||||
			where: {
 | 
			
		||||
				ID: postID
 | 
			
		||||
			},
 | 
			
		||||
			set: {
 | 
			
		||||
				niveau_visibilite: level
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Turn a database entry into a row object
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user