Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: LDCL-235: Fix data not refreshing in SSG #265

Merged
merged 2 commits into from
Nov 4, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/runtime/composables/useDrupalCe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const useDrupalCe = () => {
}))
const serverResponse = useState('server-response', () => null)
useFetchOptions.key = `page-${path}`
const page = ref(null)
let page = null
const pageError = ref(null)

if (import.meta.server) {
Expand All @@ -129,7 +129,7 @@ export const useDrupalCe = () => {
// Check if the page data is already provided, e.g. by a form response.
if (serverResponse.value) {
if (serverResponse.value._data) {
page.value = serverResponse.value._data
page = ref(serverResponse.value._data)
passThroughHeaders(nuxtApp, serverResponse.value.headers)
}
else if (serverResponse.value.error) {
Expand All @@ -142,7 +142,7 @@ export const useDrupalCe = () => {
}
else {
const { data, error } = await useCeApi(path, useFetchOptions, true)
page.value = data.value
page = data
pageError.value = error.value
}

Expand Down