Use asset-backed company logos

This commit is contained in:
Dotta
2026-03-16 09:25:39 -05:00
parent 1a5eaba622
commit e538329b0a
17 changed files with 307 additions and 57 deletions

View File

@@ -141,7 +141,7 @@ export function CompanySettings() {
mutationFn: (file: File) =>
assetsApi
.uploadImage(selectedCompanyId!, file, "companies")
.then((asset) => companiesApi.update(selectedCompanyId!, { logoUrl: asset.contentPath })),
.then((asset) => companiesApi.update(selectedCompanyId!, { logoAssetId: asset.assetId })),
onSuccess: (company) => {
syncLogoState(company.logoUrl);
setLogoUploadError(null);
@@ -149,7 +149,7 @@ export function CompanySettings() {
});
const clearLogoMutation = useMutation({
mutationFn: () => companiesApi.update(selectedCompanyId!, { logoUrl: null }),
mutationFn: () => companiesApi.update(selectedCompanyId!, { logoAssetId: null }),
onSuccess: (company) => {
setLogoUploadError(null);
syncLogoState(company.logoUrl);