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

Commit

Permalink
refactor: addHistory -> addActivity from main
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Aug 6, 2024
1 parent eb47014 commit 8c8cc11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/DataForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller, type SubmitHandler, useForm } from "react-hook-form"
import * as Form from "@radix-ui/react-form"
import React from "react"
import { addHistoryData } from "../firebase"
import { addActivityData } from "../firebase"
import { Input } from "./Input.tsx"
import { Textarea } from "./Textarea.tsx"
import Button from "./Button.tsx"
Expand All @@ -17,7 +17,7 @@ const DataForm = () => {
const { handleSubmit, control, register } = useForm<Inputs>()
const formRef = React.useRef<HTMLFormElement>(null)
const onSubmit: SubmitHandler<Inputs> = async (data) => {
await addHistoryData(data)
await addActivityData(data)
if (formRef.current) formRef.current.submit()
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/firebase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { initializeApp } from "firebase/app"
import { addDoc, collection, getDocs, getFirestore } from "firebase/firestore"
import { addDoc, collection, getDocs, getFirestore, Timestamp } from "firebase/firestore"
import { getAuth, GoogleAuthProvider, signInWithPopup, signOut } from "firebase/auth"
import firebaseConfig from "./firebase-config.json"

Expand Down

0 comments on commit 8c8cc11

Please sign in to comment.