mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Strip null values for changelog and set size limit for large content blocks
This commit is contained in:
@@ -29,7 +29,10 @@ export const load: PageServerLoad = async ({ parent, fetch, params, url }) => {
|
||||
const constructedFetchUrl = `${baseFetchUrl}&${searchParams.toString()}&limit=20&offset=${resultOffset}`;
|
||||
|
||||
const changeLog: (ChangeLog & { user: { username: User["username"] } })[] = (
|
||||
await apiRequest(fetch, constructedFetchUrl, "GET", { returnData: true })
|
||||
await apiRequest(fetch, constructedFetchUrl, "GET", {
|
||||
headers: { Accept: "application/vnd.pgrst.array+json;nulls=stripped" },
|
||||
returnData: true
|
||||
})
|
||||
).data;
|
||||
|
||||
const resultChangeLogData = await apiRequest(fetch, constructedFetchUrl, "HEAD", {
|
||||
@@ -92,7 +95,10 @@ export const actions: Actions = {
|
||||
fetch,
|
||||
`${API_BASE_PREFIX}/change_log?id=eq.${data.get("id")}&select=old_value,new_value`,
|
||||
"GET",
|
||||
{ headers: { Accept: "application/vnd.pgrst.object+json" }, returnData: true }
|
||||
{
|
||||
headers: { Accept: "application/vnd.pgrst.object+json;nulls=stripped" },
|
||||
returnData: true
|
||||
}
|
||||
)
|
||||
).data;
|
||||
|
||||
|
||||
@@ -155,14 +155,12 @@
|
||||
|
||||
{#if new_value && !old_value}
|
||||
<h4>New value</h4>
|
||||
<pre style="white-space: pre-wrap">{@html (DOMPurify.sanitize(newValue),
|
||||
{ ALLOWED_TAGS: ["ins", "del"] })}</pre>
|
||||
<pre style="white-space: pre-wrap">{DOMPurify.sanitize(newValue)}</pre>
|
||||
{/if}
|
||||
|
||||
{#if old_value && !new_value}
|
||||
<h4>Old value</h4>
|
||||
<pre style="white-space: pre-wrap">{@html (DOMPurify.sanitize(oldValue),
|
||||
{ ALLOWED_TAGS: ["ins", "del"] })}</pre>
|
||||
<pre style="white-space: pre-wrap">{DOMPurify.sanitize(oldValue)}</pre>
|
||||
{/if}
|
||||
</Modal>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user