From 44698627e10797903f34f563ffd8baeebfbd66c6 Mon Sep 17 00:00:00 2001 From: Yuto Terada Date: Sat, 26 Oct 2024 16:11:38 +0900 Subject: [PATCH] format --- task_yell/src/firebase/firestore.ts | 14 +++++++------- task_yell/src/lib/events.ts | 2 +- task_yell/src/lib/types.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/task_yell/src/firebase/firestore.ts b/task_yell/src/firebase/firestore.ts index 66381bd..80727d1 100644 --- a/task_yell/src/firebase/firestore.ts +++ b/task_yell/src/firebase/firestore.ts @@ -8,15 +8,15 @@ import { deleteDoc, doc, //追加 - WithFieldValue, - DocumentData, + type WithFieldValue, + type DocumentData, getDoc, } from "firebase/firestore"; /** dataが WithFieldValue を拡張するように制約を追加 */ export async function createData>( collectionName: string, - data: T + data: T, ): Promise { const docRef = await addDoc(collection(db, collectionName), data); return docRef.id; @@ -24,12 +24,12 @@ export async function createData>( export async function readData(collectionName: string): Promise { const snapshot = await getDocs(collection(db, collectionName)); - return snapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() } as T)); + return snapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() }) as T); } export async function readSingleData( collectionName: string, - id: string + id: string, ): Promise { const docRef = doc(db, collectionName, id); const snapshot = await getDoc(docRef); @@ -39,7 +39,7 @@ export async function readSingleData( export async function updateData( collectionName: string, id: string, - data: Partial + data: Partial, ): Promise { const docRef = doc(db, collectionName, id); await updateDoc(docRef, data); @@ -47,7 +47,7 @@ export async function updateData( export async function deleteData( collectionName: string, - id: string + id: string, ): Promise { const docRef = doc(db, collectionName, id); await deleteDoc(docRef); diff --git a/task_yell/src/lib/events.ts b/task_yell/src/lib/events.ts index c39711e..1c4c862 100644 --- a/task_yell/src/lib/events.ts +++ b/task_yell/src/lib/events.ts @@ -22,7 +22,7 @@ export async function readSingleEvent(id: string): Promise { export async function updateEvent( id: string, - eventData: Partial + eventData: Partial, ): Promise { return updateData(COLLECTION_NAME, id, eventData); } diff --git a/task_yell/src/lib/types.ts b/task_yell/src/lib/types.ts index 25b0f32..35817a5 100644 --- a/task_yell/src/lib/types.ts +++ b/task_yell/src/lib/types.ts @@ -14,4 +14,4 @@ export interface Notification { type: "call" | "push"; eventOrTaskRef: string; userId: string; -} \ No newline at end of file +}