This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getTogglProjectData = async (since: string, until: string, pageNum = 1) => { | |
const reportData = await axiosClient.get(`/reports/api/v2/details`, { | |
params: { | |
'user_agent': process.env.USER_AGENT, | |
'workspace_id': process.env.WORKSPACE_ID, | |
'project_ids': process.env.PROJECT_ID, | |
'since': since, | |
'until': until, | |
'page': pageNum | |
}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ProjectType { | |
[key: string]: string; | |
} | |
interface ProjectData { | |
projects: ProjectType; | |
projectsMetadata: ProjectType; | |
} | |
interface ProjectsProps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const [projectsData, setProjectsData] = useState({projects: {placeholder: ''}, projectsMetadata: {placeholder: ''}}); | |
... | |
useEffect(() => { | |
const getProjects = async () => { | |
let firebaseReq = await database.ref(`/`).once('value'); | |
let firebaseJSON = await firebaseReq.val(); | |
setProjectsData(firebaseJSON); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface projectsTimeInterface { | |
[key: string]: number | |
} | |
interface togglRecordInterface { | |
[key: string]: number | string | null | boolean | Array<string> | |
} | |
exports.getDailyData = functions.pubsub.schedule('0 4 * * *') | |
.timeZone('America/Mexico_City') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"total_count":2, | |
"per_page":50, | |
... | |
"data":[ | |
{ | |
... | |
"description":"tegin tööd", | |
"start":"2013-05-20T06:55:04", | |
"end":"2013-05-20T10:55:04", |