fix: inventory interface and hot keys
This commit is contained in:
parent
5f543ca6c4
commit
5e14481714
3 changed files with 221 additions and 25 deletions
|
|
@ -827,12 +827,15 @@ impl std::fmt::Display for PropOrigin {
|
|||
#[cfg_attr(feature = "ssr", derive(sqlx::FromRow))]
|
||||
pub struct InventoryItem {
|
||||
pub id: Uuid,
|
||||
/// The source prop ID (use `origin` to determine which table: Server or Realm)
|
||||
pub prop_id: Option<Uuid>,
|
||||
pub prop_name: String,
|
||||
pub prop_asset_path: String,
|
||||
pub layer: Option<AvatarLayer>,
|
||||
pub is_transferable: bool,
|
||||
pub is_portable: bool,
|
||||
pub is_droppable: bool,
|
||||
/// The source of this prop (ServerLibrary, RealmLibrary, or UserUpload)
|
||||
pub origin: PropOrigin,
|
||||
pub acquired_at: DateTime<Utc>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ pub async fn list_user_inventory<'e>(
|
|||
r#"
|
||||
SELECT
|
||||
id,
|
||||
COALESCE(server_prop_id, realm_prop_id) as prop_id,
|
||||
prop_name,
|
||||
prop_asset_path,
|
||||
layer,
|
||||
|
|
@ -271,6 +272,7 @@ pub async fn acquire_server_prop<'e>(
|
|||
AND oc.is_claimed = false
|
||||
RETURNING
|
||||
id,
|
||||
server_prop_id as prop_id,
|
||||
prop_name,
|
||||
prop_asset_path,
|
||||
layer,
|
||||
|
|
@ -447,6 +449,7 @@ pub async fn acquire_realm_prop<'e>(
|
|||
AND oc.is_claimed = false
|
||||
RETURNING
|
||||
id,
|
||||
realm_prop_id as prop_id,
|
||||
prop_name,
|
||||
prop_asset_path,
|
||||
layer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue