Skip to content

Commit

Permalink
Merge pull request #32 from jphacks/fix/ci
Browse files Browse the repository at this point in the history
ci.yamlを修正
  • Loading branch information
Inlet-back authored Oct 26, 2024
2 parents 7456e5f + 4469862 commit e589d39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
environment:
name: preview
url: ${{ steps.deploy.outputs.url }}
defaults:
run:
working-directory: task_yell
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true

- name: Mv directory
run: cd ./task_yell

- name: Install Vercel CLI
run: npm install --global vercel@latest

Expand All @@ -73,8 +73,11 @@ jobs:
needs: lint
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: task_yell
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
Expand All @@ -85,9 +88,6 @@ jobs:
- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Mv directory
run: cd ./task_yell

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

Expand Down
14 changes: 7 additions & 7 deletions task_yell/src/firebase/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ import {
deleteDoc,
doc,
//追加
WithFieldValue,
DocumentData,
type WithFieldValue,
type DocumentData,
getDoc,
} from "firebase/firestore";

/** dataが WithFieldValue<DocumentData> を拡張するように制約を追加 */
export async function createData<T extends WithFieldValue<DocumentData>>(
collectionName: string,
data: T
data: T,
): Promise<string> {
const docRef = await addDoc(collection(db, collectionName), data);
return docRef.id;
}

export async function readData<T>(collectionName: string): Promise<T[]> {
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<T>(
collectionName: string,
id: string
id: string,
): Promise<T | null> {
const docRef = doc(db, collectionName, id);
const snapshot = await getDoc(docRef);
Expand All @@ -39,15 +39,15 @@ export async function readSingleData<T>(
export async function updateData<T>(
collectionName: string,
id: string,
data: Partial<T>
data: Partial<T>,
): Promise<void> {
const docRef = doc(db, collectionName, id);
await updateDoc(docRef, data);
}

export async function deleteData(
collectionName: string,
id: string
id: string,
): Promise<void> {
const docRef = doc(db, collectionName, id);
await deleteDoc(docRef);
Expand Down
2 changes: 1 addition & 1 deletion task_yell/src/lib/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function readSingleEvent(id: string): Promise<Event | null> {

export async function updateEvent(
id: string,
eventData: Partial<Event>
eventData: Partial<Event>,
): Promise<void> {
return updateData<Event>(COLLECTION_NAME, id, eventData);
}
Expand Down
2 changes: 1 addition & 1 deletion task_yell/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export interface Notification {
type: "call" | "push";
eventOrTaskRef: string;
userId: string;
}
}

0 comments on commit e589d39

Please sign in to comment.