Skip to content

Commit

Permalink
Create ThetaService.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored May 9, 2024
1 parent 0742843 commit 6ca4171
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions server/src/services/ThetaService.js
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;

0 comments on commit 6ca4171

Please sign in to comment.