add theme patterns
This commit is contained in:
@@ -69,7 +69,15 @@ export async function patchFam(pb: any, famId: string, body: Record<string, unkn
|
||||
|
||||
export async function getProfile(pb: any, famId: string, userId: string) {
|
||||
const rec = await pb.collection('users').getOne(userId);
|
||||
return { id: rec.id, name: rec.name || '', color: rec.color || '#6366f1', email: rec.email || '' };
|
||||
return {
|
||||
id: rec.id,
|
||||
name: rec.name || '',
|
||||
color: rec.color || '#6366f1',
|
||||
pattern: rec.pattern || '',
|
||||
themeSize: rec.themeSize || '',
|
||||
themeOpacity: rec.themeOpacity || '',
|
||||
email: rec.email || ''
|
||||
};
|
||||
}
|
||||
|
||||
export async function updateProfile(
|
||||
@@ -81,9 +89,20 @@ export async function updateProfile(
|
||||
const patch: Record<string, unknown> = {};
|
||||
if (data.name) patch.name = data.name;
|
||||
if (data.color) patch.color = data.color;
|
||||
if (data.pattern !== undefined) patch.pattern = data.pattern;
|
||||
if (data.themeSize !== undefined) patch.themeSize = data.themeSize;
|
||||
if (data.themeOpacity !== undefined) patch.themeOpacity = data.themeOpacity;
|
||||
if (data.email !== undefined) patch.email = data.email;
|
||||
const rec = await pb.collection('users').update(userId, patch);
|
||||
return { id: rec.id, name: rec.name || '', color: rec.color || '#6366f1', email: rec.email || '' };
|
||||
return {
|
||||
id: rec.id,
|
||||
name: rec.name || '',
|
||||
color: rec.color || '#6366f1',
|
||||
pattern: rec.pattern || '',
|
||||
themeSize: rec.themeSize || '',
|
||||
themeOpacity: rec.themeOpacity || '',
|
||||
email: rec.email || ''
|
||||
};
|
||||
}
|
||||
|
||||
export async function weeklySummary(pb: any, famId: string) {
|
||||
@@ -309,4 +328,4 @@ export async function completeWeek(pb: any, famId: string) {
|
||||
historyRecords,
|
||||
memberCount: members.length
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user