Tweak PostgreSQL calls
This commit is contained in:
@@ -19,8 +19,8 @@ type PostgresThemeData(log: ILogger) =
|
||||
log.LogTrace "Theme.all"
|
||||
Custom.list
|
||||
$"{Query.find Table.Theme}
|
||||
WHERE data ->> '{nameof Theme.Empty.Id}' <> 'admin'
|
||||
ORDER BY data ->> '{nameof Theme.Empty.Id}'"
|
||||
WHERE data->>'{nameof Theme.Empty.Id}' <> 'admin'
|
||||
ORDER BY data->>'{nameof Theme.Empty.Id}'"
|
||||
[]
|
||||
withoutTemplateText
|
||||
|
||||
@@ -45,8 +45,8 @@ type PostgresThemeData(log: ILogger) =
|
||||
match! exists themeId with
|
||||
| true ->
|
||||
do! Custom.nonQuery
|
||||
$"""DELETE FROM {Table.ThemeAsset} WHERE theme_id = @id;
|
||||
DELETE FROM {Table.Theme} WHERE {Query.whereById "@id"}"""
|
||||
$"""{Query.delete Table.ThemeAsset} WHERE theme_id = @id;
|
||||
{Query.delete Table.Theme} WHERE {Query.whereById "@id"}"""
|
||||
[ idParam themeId ]
|
||||
return true
|
||||
| false -> return false
|
||||
@@ -77,7 +77,7 @@ type PostgresThemeAssetData(log: ILogger) =
|
||||
/// Delete all assets for the given theme
|
||||
let deleteByTheme (themeId: ThemeId) =
|
||||
log.LogTrace "ThemeAsset.deleteByTheme"
|
||||
Custom.nonQuery $"DELETE FROM {Table.ThemeAsset} WHERE theme_id = @id" [ idParam themeId ]
|
||||
Custom.nonQuery $"{Query.delete Table.ThemeAsset} WHERE theme_id = @id" [ idParam themeId ]
|
||||
|
||||
/// Find a theme asset by its ID
|
||||
let findById assetId =
|
||||
|
||||
Reference in New Issue
Block a user