1721/feature/drag and drop favorites (#2097)
* prisma schema updated: added index in favorite * update abilitiy added for favorite * update one favorite resolver added * update on favorite mutation added * updateFavoriteOrder added * Draglist added in favorite * nav item convert to div from button: because it was not working dragable with button * changed index to position * position added in getFavorites query * added recoil state for favorites * reordering updated according to new method * Use accurate type --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
16
front/src/modules/favorites/states/favoritesState.ts
Normal file
16
front/src/modules/favorites/states/favoritesState.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { Company, Favorite, Person } from '~/generated/graphql';
|
||||
|
||||
export const favoritesState = atom<
|
||||
Array<
|
||||
Pick<Favorite, 'id' | 'position'> & {
|
||||
company?: Pick<Company, 'id' | 'name' | 'domainName'>;
|
||||
} & {
|
||||
person?: Pick<Person, 'id' | 'firstName' | 'lastName' | 'avatarUrl'>;
|
||||
}
|
||||
>
|
||||
>({
|
||||
key: 'favoritesState',
|
||||
default: [],
|
||||
});
|
||||
Reference in New Issue
Block a user