Adds a restore action for soft deleted bundled themes

This commit is contained in:
BinaryAlley committed 2026-08-21 11:47:51 -07:00
1 parent 15945c2e56
commit 7e54c990ad
49 files changed
+1666 -26

No files matched your search

@@ -14,6 +14,7 @@ namespace Lumina.Presentation.Web.Common.DTO.Themes;
/// <param name="Version">The version of the theme, using semantic version form.</param>
/// <param name="PreviewUrl">The URL of the theme preview image.</param>
/// <param name="IsBundled">Whether the theme ships with the application or noy.</param>
/// <param name="IsDeleted">Whether the theme was deleted by the user, which is only possible for bundled themes.</param>
[DebuggerDisplay("Id: {Id}, Name: {Name}")]
public sealed record ThemeInfoDto(
string Id,
@@ -22,5 +23,6 @@ public sealed record ThemeInfoDto(
string Author,
string Version,
string PreviewUrl,
bool IsBundled
bool IsBundled,
bool IsDeleted
);
@@ -19,6 +19,7 @@ namespace Lumina.Presentation.Web.Common.DTO.Themes;
/// <param name="InstallSource">The source the theme was installed from.</param>
/// <param name="IsCurrent">Whether the theme is the currently active one.</param>
/// <param name="InstalledAtUtc">The UTC timestamp at which the theme was installed.</param>
/// <param name="IsDeleted">Whether the theme was deleted by the user, which is only possible for bundled themes.</param>
[DebuggerDisplay("ThemeId: {ThemeId}, Name: {Name}")]
public sealed record ThemeResponseDto(
Guid Id,
@@ -30,5 +31,6 @@ public sealed record ThemeResponseDto(
string? PreviewPath,
ThemeInstallSource InstallSource,
bool? IsCurrent,
DateTime InstalledAtUtc
DateTime InstalledAtUtc,
bool IsDeleted
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to restore a soft deleted bundled theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the bundled theme to restore.</param>
[DebuggerDisplay("ThemeId: {ThemeId}")]
public record RestoreThemeRequest(
string? ThemeId
);
@@ -18,6 +18,7 @@ public static partial class ApiRoutes
public const string GET_THEME_TEMPLATE = "themes/{themeId}/templates/{*pageKey}";
public const string GET_THEME_ASSET = "themes/{themeId}/assets/{*assetPath}";
public const string GET_THEME_ARCHIVE = "themes/{themeId}/archive";
public const string RESTORE_THEME = "themes/{themeId}/restore";
public const string DELETE_THEME = "themes/{themeId}";
}
}
@@ -13,6 +13,7 @@ public static partial class WebRoutes
public const string GET_THEMES = "{culture}/admin/themes/api-get-themes";
public const string INSTALL_THEME = "{culture}/admin/themes/api-install-theme";
public const string SET_CURRENT_THEME = "{culture}/admin/themes/api-set-current-theme";
public const string RESTORE_THEME = "{culture}/admin/themes/api-restore-theme/{themeId}";
public const string DELETE_THEME = "{culture}/admin/themes/api-delete-theme/{themeId}";
public const string DOWNLOAD_THEME = "{culture}/admin/themes/api-download-theme/{themeId}";
public const string THEME_ASSETS = "theme-assets/{themeId}/{*path}";