REF: Remove unnecessary x-tag headers from API requests in interest-related components

This commit is contained in:
Matt 2025-06-15 17:18:24 +02:00
parent 536e544d04
commit d53f4f03f5
5 changed files with 4 additions and 77 deletions

View File

@ -402,12 +402,9 @@ const createInterest = async () => {
isCreating.value = true;
try {
// Call the create-interest API
// Call the create-interest API - let browser send session cookies (Directus or OIDC)
const response = await $fetch<Interest>("/api/create-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: newInterest.value,
});

View File

@ -584,9 +584,6 @@ const generateEOI = async (retryCount = 0) => {
documensoID?: string;
}>('/api/email/generate-eoi-document', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
body: {
interestId: props.interest.Id.toString()
},
@ -658,9 +655,6 @@ const checkSignatureStatus = async () => {
try {
const response = await $fetch<any>('/api/eoi/check-signature-status', {
headers: {
'x-tag': '094ut234'
},
params: {
interestId: props.interest.Id.toString()
}
@ -731,9 +725,6 @@ const copyLink = async (link: string | undefined, linkType?: 'client' | 'cc' | '
try {
await $fetch('/api/update-interest', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
body: {
id: props.interest.Id.toString(),
data: {
@ -812,9 +803,6 @@ const uploadEOI = async (file: File) => {
const response = await $fetch<{ success: boolean; document: any; message: string }>('/api/eoi/upload-document', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
query: {
interestId: props.interest.Id.toString()
},
@ -851,9 +839,6 @@ const deleteUploadedEOI = async () => {
try {
const response = await $fetch<{ success: boolean; message: string }>('/api/eoi/delete-document', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
body: {
interestId: props.interest.Id.toString()
}
@ -878,9 +863,6 @@ const deleteGeneratedEOI = async () => {
try {
const response = await $fetch<{ success: boolean; message: string }>('/api/eoi/delete-generated-document', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
body: {
interestId: props.interest.Id.toString()
}
@ -918,9 +900,6 @@ const validateDocument = async () => {
message: string;
documentStatus?: string;
}>('/api/eoi/validate-document', {
headers: {
'x-tag': '094ut234'
},
params: {
interestId: props.interest.Id.toString()
}

View File

@ -835,9 +835,6 @@ const saveInterest = async (isAutoSave = false) => {
// Call the update-interest API
await $fetch("/api/update-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
id: interest.value.Id.toString(),
data: dataToSave,
@ -872,9 +869,6 @@ const requestMoreInfoToSales = async () => {
// Call the request-more-info-to-sales API
await $fetch("/api/request-more-info-to-sales", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id.toString(),
},
@ -898,9 +892,6 @@ const requestMoreInformation = async () => {
// Call the request-more-information API
await $fetch("/api/request-more-information", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id.toString(),
},
@ -924,9 +915,6 @@ const eoiSendToSales = async () => {
// Call the eoi-send-to-sales API
await $fetch("/api/eoi-send-to-sales", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id.toString(),
},
@ -1010,11 +998,7 @@ const groupedBerths = computed(() => {
const loadAvailableBerths = async () => {
loadingBerths.value = true;
try {
const response = await $fetch<{ list: Berth[] }>("/api/get-berths", {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
});
const response = await $fetch<{ list: Berth[] }>("/api/get-berths");
availableBerths.value = response.list || [];
} catch (error) {
console.error("Failed to load berths:", error);
@ -1032,9 +1016,6 @@ const loadLinkedBerths = async () => {
const berthsResponse = await $fetch<{ list: Array<{ Id: number }> }>(
"/api/get-interest-berths",
{
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
params: {
interestId: interest.value.Id,
linkType: "berths",
@ -1046,9 +1027,6 @@ const loadLinkedBerths = async () => {
const recommendationsResponse = await $fetch<{
list: Array<{ Id: number }>;
}>("/api/get-interest-berths", {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
params: {
interestId: interest.value.Id,
linkType: "recommendations",
@ -1085,9 +1063,6 @@ const updateBerths = async (newBerths: number[]) => {
if (toAdd.length > 0) {
await $fetch("/api/link-berths-to-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id,
berthIds: toAdd,
@ -1099,9 +1074,6 @@ const updateBerths = async (newBerths: number[]) => {
if (toRemove.length > 0) {
await $fetch("/api/unlink-berths-from-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id,
berthIds: toRemove,
@ -1136,9 +1108,6 @@ const updateBerthRecommendations = async (newRecommendations: number[]) => {
if (toAdd.length > 0) {
await $fetch("/api/link-berth-recommendations-to-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id,
berthIds: toAdd,
@ -1150,9 +1119,6 @@ const updateBerthRecommendations = async (newRecommendations: number[]) => {
if (toRemove.length > 0) {
await $fetch("/api/unlink-berth-recommendations-from-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
interestId: interest.value.Id,
berthIds: toRemove,
@ -1256,9 +1222,6 @@ const deleteInterest = async () => {
try {
const response = await $fetch("/api/delete-interest", {
method: "POST",
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
id: interest.value.Id.toString(),
},
@ -1301,9 +1264,6 @@ const onInterestUpdated = async () => {
if (interest.value) {
try {
const updatedInterest = await $fetch<Interest>(`/api/get-interest-by-id`, {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
params: {
id: interest.value.Id,
},

View File

@ -355,9 +355,6 @@ const selectedInterest = ref<Interest | null>(null);
const selectedSalesLevel = ref('all');
const { data: interests, refresh } = useFetch<InterestsResponse>("/api/get-interests", {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
onResponse() {
loading.value = false;
},

View File

@ -202,9 +202,6 @@ const draggedInterest = ref<Interest | null>(null);
const draggedFromLevel = ref<string | null>(null);
const { data: interests, refresh } = useFetch<InterestsResponse>("/api/get-interests", {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
onResponse() {
loading.value = false;
},
@ -405,13 +402,10 @@ const handleDrop = async (event: DragEvent, targetLevel: string) => {
// Update the interest's sales process level
const response = await $fetch('/api/update-interest', {
method: 'POST',
headers: {
'x-tag': user.value?.email ? "094ut234" : "pjnvü1230",
},
body: {
id: interestId,
data: {
'Sales Process Level': targetLevel
'Sales Process Level': targetLevel as InterestSalesProcessLevel
}
}
});
@ -419,7 +413,7 @@ const handleDrop = async (event: DragEvent, targetLevel: string) => {
// Update local data
const interestIndex = interests.value?.list.findIndex(i => i.Id === interestId);
if (interestIndex !== undefined && interestIndex !== -1 && interests.value) {
interests.value.list[interestIndex]['Sales Process Level'] = targetLevel;
interests.value.list[interestIndex]['Sales Process Level'] = targetLevel as InterestSalesProcessLevel;
}
// Show success message