#201229 업데이트

피망좋아해·2020년 12월 30일
0

expo

Onpress 화면 누르면 페이지로 넘어가는 기능
#16.3 강의와 searchphoto 컴포넌트를 확인하자

APP

  • ONpress 는 Component
    Query Mutaion 는 Screen 에 있다.
    앱에서 컴포넌트 스크린 무슨 기능을 하는지 정확히 모르겠다.

  • 프로필 하단에 출력되는 사진들은 파일 중에 아이디가 같은 것들을
    MAP으로 데리고 와서 스퀘어 or 포스트 형식으로 출력해준다.
    이때 MAP으로 FILE을 가져오기 때문에 아마 최신순으로 가져와서 하나씩 출력하다 보니, 역순으로 사진과 포스트가 보이게 되었다.
    그래서 맵에서 나오는 출력을 거꾸로 뒤집었다.
    posts.slice(0).reverse().map

prisma 에서 데이터를 요청할때 불러오는 순서 적용

#prisma

export default {
Query: {
seeFeed: async (_, __, { request, isAuthenticated }) => {
isAuthenticated(request);
const { user } = request;
const following = await prisma.user({ id: user.id }).following();
return prisma.posts({
where: {
user: {
id_in: [...following.map(user => user.id), user.id]
}
},
orderBy: "createdAt_DESC"
});
}
}
};

profile
Do not sell our comment

0개의 댓글