Change to using arrow functions (#1603)
* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -19,7 +19,7 @@ import { viewableActivityIdState } from '../states/viewableActivityIdState';
|
||||
import { ActivityTargetableEntity } from '../types/ActivityTargetableEntity';
|
||||
import { getRelationData } from '../utils/getRelationData';
|
||||
|
||||
export function useOpenCreateActivityDrawer() {
|
||||
export const useOpenCreateActivityDrawer = () => {
|
||||
const { openRightDrawer } = useRightDrawer();
|
||||
const [createActivityMutation] = useCreateActivityMutation();
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
@ -30,7 +30,7 @@ export function useOpenCreateActivityDrawer() {
|
||||
);
|
||||
const [, setViewableActivityId] = useRecoilState(viewableActivityIdState);
|
||||
|
||||
return function openCreateActivityDrawer({
|
||||
return ({
|
||||
type,
|
||||
targetableEntities,
|
||||
assigneeId,
|
||||
@ -38,7 +38,7 @@ export function useOpenCreateActivityDrawer() {
|
||||
type: ActivityType;
|
||||
targetableEntities?: ActivityTargetableEntity[];
|
||||
assigneeId?: string;
|
||||
}) {
|
||||
}) => {
|
||||
const now = new Date().toISOString();
|
||||
|
||||
return createActivityMutation({
|
||||
@ -73,7 +73,7 @@ export function useOpenCreateActivityDrawer() {
|
||||
getOperationName(GET_ACTIVITIES_BY_TARGETS) ?? '',
|
||||
getOperationName(GET_ACTIVITIES) ?? '',
|
||||
],
|
||||
onCompleted(data) {
|
||||
onCompleted: (data) => {
|
||||
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
|
||||
setViewableActivityId(data.createOneActivity.id);
|
||||
setActivityTargetableEntityArray(targetableEntities ?? []);
|
||||
@ -81,4 +81,4 @@ export function useOpenCreateActivityDrawer() {
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user