Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
👍 日付の並び替え
Browse files Browse the repository at this point in the history
  • Loading branch information
sey323 committed Oct 26, 2023
1 parent 3bad214 commit f0a7ad2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/facades/repositories/bingoContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const getAllBingoCardByUid = async (uid: string) => {
const querySnapshot = await firestore
.collection("bingoCard")
.where("createdUid", "==", uid)
.orderBy("updatedAt", "desc")
.get();
const bingoCard = querySnapshot.docs.map((doc) => doc.data() as BingoCard);
return bingoCard;
Expand All @@ -39,8 +40,11 @@ export const getAllBingoCardByUid = async (uid: string) => {
*/
export const getAllBingoCard = async () => {
try {
// createdUidが存在しないものを取得する
const querySnapshot = await firestore.collection("bingoCard").get();
// createdUidのカラムが存在しないものを取得する
const querySnapshot = await firestore
.collection("bingoCard")
.orderBy("updatedAt", "desc")
.get();
const bingoCard = querySnapshot.docs.map((doc) => doc.data() as BingoCard);
return bingoCard;
} catch (e) {
Expand Down

0 comments on commit f0a7ad2

Please sign in to comment.