Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/frontend/src/api/sqs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { apiClient } from "@/lib/api-client";
import { apiClient, getConfigHeaders } from "@/lib/api-client";

// --- Interfaces ---

Expand Down Expand Up @@ -233,7 +233,10 @@ export async function receiveMessagesPoll(
const url = new URL(`/api/sqs/${queueName}/messages`, window.location.origin);
url.searchParams.set("maxMessages", String(maxMessages));
url.searchParams.set("waitTimeSeconds", String(waitTimeSeconds));
const response = await fetch(url.toString(), { signal });
const response = await fetch(url.toString(), {
signal,
headers: { ...getConfigHeaders() },
});
if (!response.ok) {
const body = await response
.json()
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/lib/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useConfigStore } from "@/stores/config";

const BASE_URL = "/api";

function getConfigHeaders(): Record<string, string> {
export function getConfigHeaders(): Record<string, string> {
const { endpoint, region } = useConfigStore.getState();
return {
"x-localstack-endpoint": endpoint,
Expand Down
Loading