Show Entity task/note tabs (#1282)
* - show task tab - tab bar * - add notes tab * - fixed unused style * - add button - fixed company edit note test * - fixed merge & dropdown * - added Tests - refactored directory structure activities - moved Task/Note Pages to corresponding modules - fixed TabList * lint
This commit is contained in:
27
front/src/modules/activities/notes/hooks/useNotes.ts
Normal file
27
front/src/modules/activities/notes/hooks/useNotes.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { ActivityType, useGetActivitiesQuery } from '~/generated/graphql';
|
||||
|
||||
import { ActivityTargetableEntity } from '../../types/ActivityTargetableEntity';
|
||||
|
||||
export function useNotes(entity: ActivityTargetableEntity) {
|
||||
const { data: notesData } = useGetActivitiesQuery({
|
||||
variables: {
|
||||
where: {
|
||||
type: { equals: ActivityType.Note },
|
||||
activityTargets: {
|
||||
some: {
|
||||
OR: [
|
||||
{ companyId: { equals: entity.id } },
|
||||
{ personId: { equals: entity.id } },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const notes = notesData?.findManyActivities;
|
||||
|
||||
return {
|
||||
notes,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user