2394-feat(front): create new record on click of plus icon (#2660)
* 2394-feat(front): create new record on click of plus icon * 2394-feat(front): fix of Icon Button * 2394-fix: PR fixes --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -6,7 +6,7 @@ import { AttachmentDropdown } from '@/activities/files/components/AttachmentDrop
|
||||
import { AttachmentIcon } from '@/activities/files/components/AttachmentIcon';
|
||||
import { Attachment } from '@/activities/files/types/Attachment';
|
||||
import { downloadFile } from '@/activities/files/utils/downloadFile';
|
||||
import { useDeleteOneObjectRecord } from '@/object-record/hooks/useDeleteOneObjectRecord';
|
||||
import { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord';
|
||||
import { IconCalendar } from '@/ui/display/icon';
|
||||
import {
|
||||
FieldContext,
|
||||
@ -60,8 +60,8 @@ export const AttachmentRow = ({ attachment }: { attachment: Attachment }) => {
|
||||
[attachment?.id],
|
||||
);
|
||||
|
||||
const { deleteOneObject: deleteOneAttachment } =
|
||||
useDeleteOneObjectRecord<Attachment>({
|
||||
const { deleteOneRecord: deleteOneAttachment } =
|
||||
useDeleteOneRecord<Attachment>({
|
||||
objectNameSingular: 'attachment',
|
||||
});
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { Attachment } from '@/activities/files/types/Attachment';
|
||||
import { getFileType } from '@/activities/files/utils/getFileType';
|
||||
import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity';
|
||||
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
||||
import { useCreateOneObjectRecord } from '@/object-record/hooks/useCreateOneObjectRecord';
|
||||
import { useCreateOneRecord } from '@/object-record/hooks/useCreateOneRecord';
|
||||
import { IconPlus } from '@/ui/display/icon';
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { FileFolder, useUploadFileMutation } from '~/generated/graphql';
|
||||
@ -65,8 +65,8 @@ export const Attachments = ({
|
||||
|
||||
const [uploadFile] = useUploadFileMutation();
|
||||
|
||||
const { createOneObject: createOneAttachment } =
|
||||
useCreateOneObjectRecord<Attachment>({
|
||||
const { createOneRecord: createOneAttachment } =
|
||||
useCreateOneRecord<Attachment>({
|
||||
objectNameSingular: 'attachment',
|
||||
});
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Attachment } from '@/activities/files/types/Attachment';
|
||||
import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords';
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
|
||||
import { ActivityTargetableEntity } from '../../types/ActivityTargetableEntity';
|
||||
|
||||
export const useAttachments = (entity: ActivityTargetableEntity) => {
|
||||
const { objects: attachments } = useFindManyObjectRecords({
|
||||
const { records: attachments } = useFindManyRecords({
|
||||
objectNamePlural: 'attachments',
|
||||
filter: {
|
||||
[entity.type === 'Company' ? 'companyId' : 'personId']: { eq: entity.id },
|
||||
|
||||
Reference in New Issue
Block a user