-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import axios from 'axios'; | ||
|
||
const ThetaService = { | ||
async getThetaData(symbol) { | ||
try { | ||
const response = await axios.get(`/api/theta/${symbol}`); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error('Failed to get Theta data'); | ||
} | ||
}, | ||
|
||
async postThetaData(symbol, data) { | ||
try { | ||
const response = await axios.post(`/api/theta/${symbol}`, data); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error('Failed to post Theta data'); | ||
} | ||
}, | ||
|
||
async deleteThetaData(symbol, id) { | ||
try { | ||
const response = await axios.delete(`/api/theta/${symbol}/${id}`); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error('Failed to delete Theta data'); | ||
} | ||
}, | ||
}; | ||
|
||
export default ThetaService; |