From 1398e9579be8a0ad478ef16085b431fbb97311f1 Mon Sep 17 00:00:00 2001 From: asketonim Date: Thu, 2 Jan 2020 23:06:25 +0300 Subject: Implement post request --- src/components/Timer/Timer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/Timer/Timer.js b/src/components/Timer/Timer.js index b10936f..367cce5 100644 --- a/src/components/Timer/Timer.js +++ b/src/components/Timer/Timer.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; +import {post} from '../../requests'; const Timer = () => { const SPACE = 32 @@ -35,10 +36,10 @@ const Timer = () => { return resultTime; }), 10)) } else { - clearInterval(timer) + clearInterval(timer); setRunning(false); startingTime = 0; - console.log(time) + post('solutions/', {result: time}); return false; } } -- cgit v1.2.3