mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 03:10:38 +09:00
Add support for company logos, including schema adjustments, validation, assets handling, and UI display enhancements.
This commit is contained in:
parent
b155415d7d
commit
b19d0b6f3b
17 changed files with 6211 additions and 26 deletions
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue