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 // create "a" HTML element with href to file & click
const link = document.createElement('a') const link = document.createElement('a')
link.href = response.data.download_url link.href = response.data.download_url
link.download = file_name link.setAttribute('download', file_name)
link.target = '_blank' // link.target = '_blank'
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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