(&self, user_id: u64)
| 1074 | } |
| 1075 | |
| 1076 | pub async fn get_user_plugins(&self, user_id: u64) -> ConfigStoreResult<Vec<Plugin>> { |
| 1077 | let raw_plugins = sqlx::query_as!( |
| 1078 | DbPlugin, |
| 1079 | r#"SELECT id, |
| 1080 | created_at, |
| 1081 | name, |
| 1082 | short_description, |
| 1083 | long_description, |
| 1084 | is_published, |
| 1085 | is_official, |
| 1086 | plugin_kind, |
| 1087 | current_version_number, |
| 1088 | script_published_source, |
| 1089 | script_published_version_updated_at, |
| 1090 | script_dev_source, |
| 1091 | script_dev_version_updated_at, |
| 1092 | author_id, |
| 1093 | is_public, |
| 1094 | discord_thread_id, |
| 1095 | installed_guilds, |
| 1096 | installed_guilds_updated_at |
| 1097 | FROM plugins WHERE author_id = $1 |
| 1098 | ORDER BY id ASC"#, |
| 1099 | user_id as i64, |
| 1100 | ) |
| 1101 | .fetch_all(&self.pool) |
| 1102 | .await?; |
| 1103 | |
| 1104 | let mut res: Vec<Plugin> = Vec::new(); |
| 1105 | for plugin in raw_plugins.into_iter() { |
| 1106 | let images = self.get_plugin_images_with_pool(plugin.id as u64).await?; |
| 1107 | res.push(PluginAndImages(plugin, images).into()); |
| 1108 | } |
| 1109 | |
| 1110 | Ok(res) |
| 1111 | } |
| 1112 | |
| 1113 | pub async fn get_published_public_plugins(&self) -> ConfigStoreResult<Vec<Plugin>> { |
| 1114 | let raw_plugins = sqlx::query_as!( |
no test coverage detected