Necessary change for converting to GET method

This commit is contained in:
jetli 2024-09-12 18:42:17 -07:00
parent 4d0d5d3884
commit 7f8ca4503d
8 changed files with 75 additions and 99 deletions

View File

@ -298,8 +298,8 @@ export default {
// create "a" HTML element with href to file & click
const link = document.createElement('a')
link.href = response.data.download_url
link.download = file_name
link.target = '_blank'
link.setAttribute('download', file_name)
// link.target = '_blank'
document.body.appendChild(link)
link.click()

View File

@ -1,39 +1,32 @@
import { backendAxios } from './axios'
class ContentApi {
static retrieve_blogs(host) {
const request = backendAxios.post('/api/content/retrieve-blogs', { host: host }, {})
const request = backendAxios.get('/api/content/retrieve-blogs', { params: { host: host } })
return request
}
static retrieve_blog_content(document_id) {
const request = backendAxios.post(
const request = backendAxios.get(
'/api/content/retrieve-blog-content',
{
document_id: document_id
},
{}
{ params: { document_id: document_id } }
)
return request
}
static retrieve_about_directories(host) {
const request = backendAxios.post('/api/content/retrieve-about-directories', { host: host }, {})
const request = backendAxios.get('/api/content/retrieve-about-directories', { params: { host: host } })
return request
}
static retrieve_career_directories(host) {
const request = backendAxios.post(
const request = backendAxios.get(
'/api/content/retrieve-career-directories',
{ host: host },
{}
{ params: { host: host } }
)
return request
}
static retrieve_contact_directories(host) {
const request = backendAxios.post(
const request = backendAxios.get(
'/api/content/retrieve-contact-directories',
{
host: host
},
{}
{ params: { host: host } }
)
return request
}

View File

@ -4,10 +4,10 @@ import { userUtils } from '../store/index'
class HistoryApi {
static fetchClosedWorkspackeProjects() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/user/history/fetch-workspace-closed-projects',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)

View File

@ -4,12 +4,10 @@ import { backendAxios } from './axios'
class MessageHubApi {
static fetchConversations(last_update_time, jwt) {
// let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/messages/fetch-conversations-for-user',
{
last_update_time: last_update_time
},
{
params: { last_update_time: last_update_time },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -17,13 +15,13 @@ class MessageHubApi {
}
static fetchMessages(conversation_id, last_update_time, jwt) {
// let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/messages/fetch-message-thread-for-conversation',
{
conversation_id: conversation_id,
last_update_time: last_update_time
},
{
params: {
conversation_id: conversation_id,
last_update_time: last_update_time
},
headers: { Authorization: `Bearer ${jwt}` }
}
)

View File

@ -4,10 +4,10 @@ import { userUtils } from '../store/index'
class ProviderHubApi {
static fetchProvidersForHub() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/providers/fetch-providers-for-hub',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -15,10 +15,10 @@ class ProviderHubApi {
}
static fetchOpenRequest() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
' /api/providers/fetch-my-open-requests',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)

View File

@ -4,10 +4,10 @@ import { userUtils } from '../store/index'
class RequestHubApi {
static fetchRequestForHub() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/requests/fetch-requests-for-hub',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -15,12 +15,10 @@ class RequestHubApi {
}
static fetchRequestForProposal(request_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/requests/fetch-request-for-proposal',
{
request_id: request_id
},
{
params: { request_id: request_id },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -28,10 +26,10 @@ class RequestHubApi {
}
static fetchMyProposals() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/requests/fetch-my-proposals',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -39,10 +37,10 @@ class RequestHubApi {
}
static fetchTemplatesForProposal() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/requests/fetch-templates-for-proposal',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)

View File

@ -4,10 +4,10 @@ import { userUtils } from '../store/index'
class UserProfileApi {
static fetchUserProfile() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/user/profile/fetch-profile',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -210,12 +210,10 @@ class UserProfileApi {
}
static fetchSelfIntroTemplates(tags) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/user/profile/fetch-templates-for-self-intro',
{
tags: tags
},
{
params: { tags: tags }, // Pass as query parameter
headers: { Authorization: `Bearer ${jwt}` }
}
)

View File

@ -35,10 +35,10 @@ class WorksapceApi {
static fetchWorkspaceRequests() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/project/fetch-workspace-requests',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -47,10 +47,10 @@ class WorksapceApi {
static fetchWorkspaceProposals() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/project/fetch-workspace-proposals',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -59,10 +59,10 @@ class WorksapceApi {
static fetchWorkspaceProjects() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/project/fetch-workspace-projects',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -71,10 +71,10 @@ class WorksapceApi {
static fetchWorkspaceView() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/project/fetch-workspace-view',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -110,12 +110,11 @@ class WorksapceApi {
static fetchProject(project_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/project/fetch-project',
{
project_id: project_id
},
{
params: { project_id: project_id },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -163,12 +162,10 @@ class WorksapceApi {
static fetchProductIssues(product_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/product/fetch-product-issues',
{
product_id: product_id
},
{
params: { product_id: product_id },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -177,12 +174,10 @@ class WorksapceApi {
static fetchProductCodeDepot(product_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/product/fetch-product-code-depot',
{
product_id: product_id
},
{
params: { product_id: product_id },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -206,10 +201,10 @@ class WorksapceApi {
static fetchTagsForRequest() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-tags-for-request',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -245,10 +240,10 @@ class WorksapceApi {
static fetchProducts() {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/product/fetch-my-products',
{},
{
params: {},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -257,13 +252,13 @@ class WorksapceApi {
static fetchTemplates(tags, host) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-templates-for-request',
{
tags: tags,
host: host
},
{
params: {
tags: tags,
host: host
},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -272,12 +267,10 @@ class WorksapceApi {
static fetchMyExistingRequests(tags) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-my-existing-requests',
{
tags: tags
},
{
params: { tags: tags },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -286,12 +279,10 @@ class WorksapceApi {
static fetchRequest(request_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-request',
{
request_id: request_id
},
{
params: { request_id: request_id },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -300,13 +291,13 @@ class WorksapceApi {
static fetchProposalForRequest(request_id, proposal_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-proposal-for-request',
{
request_id: request_id,
proposal_id: proposal_id
},
{
params: {
request_id: request_id,
proposal_id: proposal_id
},
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -315,12 +306,10 @@ class WorksapceApi {
static fetchProposalsForRequest(request_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-proposals-for-request',
{
request_id: request_id
},
{
params: { request_id: request_id, },
headers: { Authorization: `Bearer ${jwt}` }
}
)
@ -385,13 +374,13 @@ class WorksapceApi {
}
static fetchAttachedFileAsMediaData(request_id, document_id) {
let jwt = userUtils.getJwtToken()
const request = backendAxios.post(
const request = backendAxios.get(
'/api/workspace/request/fetch-attached-file-as-media-data',
{
request_id: request_id,
document_id: document_id
},
{
params: {
request_id: request_id,
document_id: document_id
},
headers: { Authorization: `Bearer ${jwt}` }
}
)