feat: add shared @sexy.pivoine.art/types package and fix type safety across frontend/backend
- Create packages/types with shared TypeScript domain model interfaces (User, Video, Model, Article, Comment, Recording, etc.) - Wire both frontend and backend packages to use @sexy.pivoine.art/types via workspace:* - Update backend Pothos objectRef types to use shared interfaces instead of inline types - Update frontend $lib/types.ts to re-export from shared package - Fix all type errors introduced by more accurate nullable types (avatar/banner as string|null UUIDs, author nullable, events/device_info as object[]) - Add artist_name to comment user select in backend resolver - Widen utility function signatures (getAssetUrl, getUserInitials, calcReadingTime) to accept null/undefined Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
let lastName = $state(data.authStatus.user!.last_name);
|
||||
let artistName = $state(data.authStatus.user!.artist_name);
|
||||
let description = $state(data.authStatus.user!.description);
|
||||
let tags = $state(data.authStatus.user!.tags);
|
||||
let tags = $state(data.authStatus.user!.tags ?? undefined);
|
||||
|
||||
let email = $state(data.authStatus.user!.email);
|
||||
let password = $state("");
|
||||
@@ -60,8 +60,8 @@
|
||||
|
||||
let avatarId = undefined;
|
||||
|
||||
if (!avatar?.id && data.authStatus.user!.avatar?.id) {
|
||||
await removeFile(data.authStatus.user!.avatar.id);
|
||||
if (!avatar?.id && data.authStatus.user!.avatar) {
|
||||
await removeFile(data.authStatus.user!.avatar);
|
||||
}
|
||||
|
||||
if (avatar?.file) {
|
||||
@@ -143,10 +143,10 @@
|
||||
function setExistingAvatar() {
|
||||
if (data.authStatus.user!.avatar) {
|
||||
avatar = {
|
||||
id: data.authStatus.user!.avatar.id,
|
||||
url: getAssetUrl(data.authStatus.user!.avatar.id, "mini")!,
|
||||
name: data.authStatus.user!.artist_name,
|
||||
size: data.authStatus.user!.avatar.filesize,
|
||||
id: data.authStatus.user!.avatar,
|
||||
url: getAssetUrl(data.authStatus.user!.avatar, "mini")!,
|
||||
name: data.authStatus.user!.artist_name ?? "",
|
||||
size: 0,
|
||||
};
|
||||
} else {
|
||||
avatar = undefined;
|
||||
|
||||
Reference in New Issue
Block a user