Skip to content

Bug/117 bug template selection#123

Merged
felix-schultz merged 2 commits intodevfrom
bug/117-bug-template-selection
Jul 25, 2025
Merged

Bug/117 bug template selection#123
felix-schultz merged 2 commits intodevfrom
bug/117-bug-template-selection

Conversation

@felix-schultz
Copy link
Copy Markdown
Member

This pull request introduces several improvements to the TemplateState logic in the desktop app and refactors permission handling in the API to enhance maintainability and functionality. Key changes include removing unused code in the TemplateState class, centralizing permission checks with a new utility function, and optimizing database queries for template access.

Desktop App Changes:

  • Code Simplification in TemplateState:
    • Removed unused injectDataFunction logic and associated background task handling, simplifying the getTemplates method (apps/desktop/components/tauri-provider/template-state.ts: [1] [2].
    • Adjusted the fetcher call to clean up redundant null assertion (apps/desktop/components/tauri-provider/template-state.ts: apps/desktop/components/tauri-provider/template-state.tsL102-R100).

API Changes:

  • Permission Handling Refactor:

    • Introduced a new utility function has_role_permission to centralize permission checks, replacing inline logic across the codebase (packages/api/src/permission/role_permission.rs: [1] packages/api/src/middleware/jwt.rs: [2].
    • Updated imports to include has_role_permission, ensuring consistent usage (packages/api/src/middleware/jwt.rs: [1] packages/api/src/routes/user/templates.rs: [2].
  • Database Query Optimization:

  • Metadata Fallback Logic:

@felix-schultz felix-schultz merged commit 08ba11f into dev Jul 25, 2025
1 of 4 checks passed
@felix-schultz felix-schultz deleted the bug/117-bug-template-selection branch July 25, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant