Update favorites query and state to work with new backend (#2520)

* wip

* wip

* adding favorite works in the database

* favorites are showing in the left drawer

* update favoorite NavItem link

* wip

* adding favorite works

* everything seems to work

* fix delete bug

* fix update favorite position

* update Favorite type

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
bosiraphael
2023-11-15 16:17:50 +01:00
committed by GitHub
parent f49ddec2f6
commit 1fc3124d1e
14 changed files with 317 additions and 192 deletions

View File

@ -1,16 +1,8 @@
import { atom } from 'recoil';
import { Company, Favorite, Person } from '~/generated/graphql';
import { Favorite } from '@/favorites/types/Favorite';
export const favoritesState = atom<
Array<
Pick<Favorite, 'id' | 'position'> & {
company?: Pick<Company, 'id' | 'name' | 'domainName'>;
} & {
person?: Pick<Person, 'id' | 'firstName' | 'lastName' | 'avatarUrl'>;
}
>
>({
export const favoritesState = atom<Favorite[]>({
key: 'favoritesState',
default: [],
});