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: send updated data back to client from all update pages endpoints #1193

Merged
merged 1 commit into from
Mar 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class CollectionPageService {
) {
const parsedCollectionName = `_${collectionName}`
const newContent = convertDataToMarkdown(frontMatter, content)
const {
frontMatter: newFrontMatter,
pageContent: newPageContent,
} = retrieveDataFromMarkdown(newContent)
const { newSha } = await this.gitHubService.update(sessionData, {
fileContent: newContent,
sha,
Expand All @@ -78,7 +82,7 @@ class CollectionPageService {
})
return {
fileName,
content: { frontMatter, pageBody: content },
content: { frontMatter: newFrontMatter, pageBody: newPageContent },
oldSha: sha,
newSha,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class ResourcePageService {
resourceCategoryName,
})
const newContent = convertDataToMarkdown(frontMatter, content)
const {
frontMatter: newFrontMatter,
pageContent: newPageContent,
} = retrieveDataFromMarkdown(newContent)
const { newSha } = await this.gitHubService.update(sessionData, {
fileContent: newContent,
sha,
Expand All @@ -101,7 +105,7 @@ class ResourcePageService {
})
return {
fileName,
content: { frontMatter, pageBody: content },
content: { frontMatter: newFrontMatter, pageBody: newPageContent },
oldSha: sha,
newSha,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class SubcollectionPageService {
) {
const parsedDirectoryName = `_${collectionName}/${subcollectionName}`
const newContent = convertDataToMarkdown(frontMatter, content)
const {
frontMatter: newFrontMatter,
pageContent: newPageContent,
} = retrieveDataFromMarkdown(newContent)
const { newSha } = await this.gitHubService.update(sessionData, {
fileContent: newContent,
sha,
Expand All @@ -77,7 +81,7 @@ class SubcollectionPageService {
})
return {
fileName,
content: { frontMatter, pageBody: content },
content: { frontMatter: newFrontMatter, pageBody: newPageContent },
oldSha: sha,
newSha,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class UnlinkedPageService {

async update(sessionData, { fileName, content, frontMatter, sha }) {
const newContent = convertDataToMarkdown(frontMatter, content)
const {
frontMatter: newFrontMatter,
pageContent: newPageContent,
} = retrieveDataFromMarkdown(newContent)
const { newSha } = await this.gitHubService.update(sessionData, {
fileContent: newContent,
sha,
Expand All @@ -59,7 +63,7 @@ class UnlinkedPageService {
})
return {
fileName,
content: { frontMatter, pageBody: content },
content: { frontMatter: newFrontMatter, pageBody: newPageContent },
oldSha: sha,
newSha,
}
Expand Down
Loading