added server and realm tabs to inventory screen
This commit is contained in:
parent
ee425e224e
commit
acab2f017d
12 changed files with 647 additions and 151 deletions
|
|
@ -52,6 +52,7 @@ pub async fn get_server_prop_by_id<'e>(
|
|||
is_transferable,
|
||||
is_portable,
|
||||
is_droppable,
|
||||
is_public,
|
||||
is_active,
|
||||
available_from,
|
||||
available_until,
|
||||
|
|
@ -114,17 +115,22 @@ pub async fn create_server_prop<'e>(
|
|||
(None, None, None)
|
||||
};
|
||||
|
||||
let is_droppable = req.droppable.unwrap_or(true);
|
||||
let is_public = req.public.unwrap_or(false);
|
||||
|
||||
let prop = sqlx::query_as::<_, ServerProp>(
|
||||
r#"
|
||||
INSERT INTO server.props (
|
||||
name, slug, description, tags, asset_path,
|
||||
default_layer, default_emotion, default_position,
|
||||
is_droppable, is_public,
|
||||
created_by
|
||||
)
|
||||
VALUES (
|
||||
$1, $2, $3, $4, $5,
|
||||
$6::server.avatar_layer, $7::server.emotion_state, $8,
|
||||
$9
|
||||
$9, $10,
|
||||
$11
|
||||
)
|
||||
RETURNING
|
||||
id,
|
||||
|
|
@ -141,6 +147,7 @@ pub async fn create_server_prop<'e>(
|
|||
is_transferable,
|
||||
is_portable,
|
||||
is_droppable,
|
||||
is_public,
|
||||
is_active,
|
||||
available_from,
|
||||
available_until,
|
||||
|
|
@ -157,6 +164,8 @@ pub async fn create_server_prop<'e>(
|
|||
.bind(&default_layer)
|
||||
.bind(&default_emotion)
|
||||
.bind(default_position)
|
||||
.bind(is_droppable)
|
||||
.bind(is_public)
|
||||
.bind(created_by)
|
||||
.fetch_one(executor)
|
||||
.await?;
|
||||
|
|
@ -198,17 +207,22 @@ pub async fn upsert_server_prop<'e>(
|
|||
(None, None, None)
|
||||
};
|
||||
|
||||
let is_droppable = req.droppable.unwrap_or(true);
|
||||
let is_public = req.public.unwrap_or(false);
|
||||
|
||||
let prop = sqlx::query_as::<_, ServerProp>(
|
||||
r#"
|
||||
INSERT INTO server.props (
|
||||
name, slug, description, tags, asset_path,
|
||||
default_layer, default_emotion, default_position,
|
||||
is_droppable, is_public,
|
||||
created_by
|
||||
)
|
||||
VALUES (
|
||||
$1, $2, $3, $4, $5,
|
||||
$6::server.avatar_layer, $7::server.emotion_state, $8,
|
||||
$9
|
||||
$9, $10,
|
||||
$11
|
||||
)
|
||||
ON CONFLICT (slug) DO UPDATE SET
|
||||
name = EXCLUDED.name,
|
||||
|
|
@ -218,6 +232,8 @@ pub async fn upsert_server_prop<'e>(
|
|||
default_layer = EXCLUDED.default_layer,
|
||||
default_emotion = EXCLUDED.default_emotion,
|
||||
default_position = EXCLUDED.default_position,
|
||||
is_droppable = EXCLUDED.is_droppable,
|
||||
is_public = EXCLUDED.is_public,
|
||||
updated_at = now()
|
||||
RETURNING
|
||||
id,
|
||||
|
|
@ -234,6 +250,7 @@ pub async fn upsert_server_prop<'e>(
|
|||
is_transferable,
|
||||
is_portable,
|
||||
is_droppable,
|
||||
is_public,
|
||||
is_active,
|
||||
available_from,
|
||||
available_until,
|
||||
|
|
@ -250,6 +267,8 @@ pub async fn upsert_server_prop<'e>(
|
|||
.bind(&default_layer)
|
||||
.bind(&default_emotion)
|
||||
.bind(default_position)
|
||||
.bind(is_droppable)
|
||||
.bind(is_public)
|
||||
.bind(created_by)
|
||||
.fetch_one(executor)
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue