-
Notifications
You must be signed in to change notification settings - Fork 1
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
4 changed files
with
24 additions
and
28 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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
// src/services/v1/genreAPIService.js | ||
|
||
import axios from 'axios' | ||
import api from '@/services/axiosInstance' | ||
|
||
const API_BASE_URL = process.env.VUE_APP_BACKEND_URL | ||
const content = 'genre' | ||
const version = 'v1' | ||
|
||
export default { | ||
async fetchV1GenreDetails (id = null) { | ||
const URL = `${API_BASE_URL}/book/${version}/${content}/${id}/` | ||
console.log('Genre Details API:', URL) | ||
export const fetchV1GenreDetails = async (id = null) => { | ||
const URL = `${API_BASE_URL}/book/${version}/${content}/${id}/` | ||
console.log('Genre Details API:', URL) | ||
|
||
try { | ||
const response = await axios.get(URL) | ||
return response.data | ||
} catch (error) { | ||
console.error('Error fetching genre:', error) | ||
throw error | ||
} | ||
try { | ||
const response = await api.get(URL) | ||
return response.data | ||
} catch (error) { | ||
console.error('Error fetching genre:', error) | ||
throw error | ||
} | ||
} |
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
// src/services/v1/topicAPIService.js | ||
|
||
import axios from 'axios' | ||
import api from '@/services/axiosInstance' | ||
|
||
const API_BASE_URL = process.env.VUE_APP_BACKEND_URL | ||
const content = 'topic' | ||
const version = 'v1' | ||
|
||
export default { | ||
async fetchV1TopicDetails (id = null) { | ||
const URL = `${API_BASE_URL}/book/${version}/${content}/${id}/` | ||
console.log('topic Details API:', URL) | ||
export const fetchV1TopicDetails = async (id = null) => { | ||
const URL = `${API_BASE_URL}/book/${version}/${content}/${id}/` | ||
console.log('topic Details API:', URL) | ||
|
||
try { | ||
const response = await axios.get(URL) | ||
return response.data | ||
} catch (error) { | ||
console.error('Error fetching topic:', error) | ||
throw error | ||
} | ||
try { | ||
const response = await api.get(URL) | ||
return response.data | ||
} catch (error) { | ||
console.error('Error fetching topic:', error) | ||
throw error | ||
} | ||
} |
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
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