Add support for company logos, including schema adjustments, validation, assets handling, and UI display enhancements.
This commit is contained in:
@@ -29,6 +29,7 @@ interface CompanyContextValue {
|
||||
name: string;
|
||||
description?: string | null;
|
||||
budgetMonthlyCents?: number;
|
||||
logoUrl?: string | null;
|
||||
}) => Promise<Company>;
|
||||
}
|
||||
|
||||
@@ -86,7 +87,12 @@ export function CompanyProvider({ children }: { children: ReactNode }) {
|
||||
}, [queryClient]);
|
||||
|
||||
const createMutation = useMutation({
|
||||
mutationFn: (data: { name: string; description?: string | null; budgetMonthlyCents?: number }) =>
|
||||
mutationFn: (data: {
|
||||
name: string;
|
||||
description?: string | null;
|
||||
budgetMonthlyCents?: number;
|
||||
logoUrl?: string | null;
|
||||
}) =>
|
||||
companiesApi.create(data),
|
||||
onSuccess: (company) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.companies.all });
|
||||
@@ -95,7 +101,12 @@ export function CompanyProvider({ children }: { children: ReactNode }) {
|
||||
});
|
||||
|
||||
const createCompany = useCallback(
|
||||
async (data: { name: string; description?: string | null; budgetMonthlyCents?: number }) => {
|
||||
async (data: {
|
||||
name: string;
|
||||
description?: string | null;
|
||||
budgetMonthlyCents?: number;
|
||||
logoUrl?: string | null;
|
||||
}) => {
|
||||
return createMutation.mutateAsync(data);
|
||||
},
|
||||
[createMutation],
|
||||
|
||||
Reference in New Issue
Block a user