Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend/app/schemas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Pydantic request / response models for QyverixAI."""

from __future__ import annotations
from pydantic import BaseModel, Field, field_validator
from pydantic import BaseModel, Field, field_validator, model_validator


class CodeRequest(BaseModel):
Expand Down Expand Up @@ -131,6 +131,14 @@ class ShareCreateRequest(BaseModel):
code: str
result: dict

@model_validator(mode="after")
def validate_fields(self) -> "ShareCreateRequest":
if not self.code or not self.code.strip():
raise ValueError("code must not be empty")
if not self.result:
raise ValueError("result must not be empty")
return self


class ShareRecord(BaseModel):
id: str
Expand Down
6 changes: 3 additions & 3 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
(function() {
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const savedTheme = localStorage.getItem('qyx_theme') || (systemDark ? 'dark' : 'light');
const savedTheme = localStorage.getItem('qyverix_theme') || (systemDark ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', savedTheme);
})();
</script>
Expand Down Expand Up @@ -2817,7 +2817,7 @@ <h3 data-i18n="empty_suggest_title">No suggestions yet</h3>
}

const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const initialTheme = localStorage.getItem('qyx_theme') || (systemDark ? 'dark' : 'light');
const initialTheme = localStorage.getItem('qyverix_theme') || (systemDark ? 'dark' : 'light');

document.documentElement.setAttribute('data-theme', initialTheme);
setThemeIcon(initialTheme);
Expand All @@ -2826,7 +2826,7 @@ <h3 data-i18n="empty_suggest_title">No suggestions yet</h3>
const cur = document.documentElement.getAttribute('data-theme');
const next = cur === 'dark' ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', next);
localStorage.setItem('qyx_theme', next);
localStorage.setItem('qyverix_theme', next);
setThemeIcon(next);
});

Expand Down