fix several bugs

This commit is contained in:
DioCrafts
2025-04-10 01:43:25 +02:00
parent 9e73d50a44
commit 5d67bc4d84
19 changed files with 335 additions and 113 deletions
+3 -3
View File
@@ -210,7 +210,7 @@ impl WebDavAdapter {
files: &[FileDto],
subfolders: &[FolderDto],
request: &PropFindRequest,
depth: &str,
_depth: &str,
base_href: &str,
) -> Result<()> {
let mut xml_writer = Writer::new(writer);
@@ -226,7 +226,7 @@ impl WebDavAdapter {
}
// If depth allows, add responses for files and subfolders
if depth != "0" {
if _depth != "0" {
// Add responses for files
for file in files {
Self::write_file_response(&mut xml_writer, file, request, &format!("{}{}", base_href, file.name))?;
@@ -249,7 +249,7 @@ impl WebDavAdapter {
writer: W,
file: &FileDto,
request: &PropFindRequest,
depth: &str,
_depth: &str,
href: &str,
) -> Result<()> {
let mut xml_writer = Writer::new(writer);
@@ -38,7 +38,7 @@ impl FavoritesUseCase for FavoritesService {
item_type as "item_type",
created_at as "created_at"
FROM auth.user_favorites
WHERE user_id = $1
WHERE user_id = $1::TEXT
ORDER BY created_at DESC
"#
)
@@ -90,7 +90,7 @@ impl FavoritesUseCase for FavoritesService {
sqlx::query(
r#"
INSERT INTO auth.user_favorites (user_id, item_id, item_type)
VALUES ($1, $2, $3)
VALUES ($1::TEXT, $2, $3)
ON CONFLICT (user_id, item_id, item_type) DO NOTHING
"#
)
@@ -123,7 +123,7 @@ impl FavoritesUseCase for FavoritesService {
let result = sqlx::query(
r#"
DELETE FROM auth.user_favorites
WHERE user_id = $1 AND item_id = $2 AND item_type = $3
WHERE user_id = $1::TEXT AND item_id = $2 AND item_type = $3
"#
)
.bind(user_uuid)
@@ -164,7 +164,7 @@ impl FavoritesUseCase for FavoritesService {
r#"
SELECT EXISTS (
SELECT 1 FROM auth.user_favorites
WHERE user_id = $1 AND item_id = $2 AND item_type = $3
WHERE user_id = $1::TEXT AND item_id = $2 AND item_type = $3
) AS "is_favorite"
"#
)
+5 -5
View File
@@ -45,7 +45,7 @@ impl RecentItemsUseCase for RecentService {
item_type as "item_type",
accessed_at as "accessed_at"
FROM auth.user_recent_files
WHERE user_id = $1
WHERE user_id = $1::TEXT
ORDER BY accessed_at DESC
LIMIT $2
"#
@@ -99,7 +99,7 @@ impl RecentItemsUseCase for RecentService {
sqlx::query(
r#"
INSERT INTO auth.user_recent_files (user_id, item_id, item_type, accessed_at)
VALUES ($1, $2, $3, CURRENT_TIMESTAMP)
VALUES ($1::TEXT, $2, $3, CURRENT_TIMESTAMP)
ON CONFLICT (user_id, item_id, item_type)
DO UPDATE SET accessed_at = CURRENT_TIMESTAMP
"#
@@ -136,7 +136,7 @@ impl RecentItemsUseCase for RecentService {
let result = sqlx::query(
r#"
DELETE FROM auth.user_recent_files
WHERE user_id = $1 AND item_id = $2 AND item_type = $3
WHERE user_id = $1::TEXT AND item_id = $2 AND item_type = $3
"#
)
.bind(user_uuid)
@@ -176,7 +176,7 @@ impl RecentItemsUseCase for RecentService {
sqlx::query(
r#"
DELETE FROM auth.user_recent_files
WHERE user_id = $1
WHERE user_id = $1::TEXT
"#
)
.bind(user_uuid)
@@ -208,7 +208,7 @@ impl RecentService {
DELETE FROM auth.user_recent_files
WHERE id IN (
SELECT id FROM auth.user_recent_files
WHERE user_id = $1
WHERE user_id = $1::TEXT
ORDER BY accessed_at DESC
OFFSET $2
)