feat: new storage link
This commit is contained in:
parent
d1a43f23e2
commit
250a4b032f
@ -36,7 +36,7 @@ export const ViewPage = () => {
|
|||||||
const data = await getData(QID)
|
const data = await getData(QID)
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const settings = data.settings
|
const settings = data.settings
|
||||||
const parseData = {
|
const parseData = replaceSpacesToEmptyLines({
|
||||||
settings: {
|
settings: {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
qid: QID,
|
qid: QID,
|
||||||
@ -50,7 +50,7 @@ export const ViewPage = () => {
|
|||||||
pausable: settings.pausable
|
pausable: settings.pausable
|
||||||
},
|
},
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
items: replaceSpacesToEmptyLines(
|
items:
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
data.items.map((item) => {
|
data.items.map((item) => {
|
||||||
const content = JSON.parse(item.c)
|
const content = JSON.parse(item.c)
|
||||||
@ -63,10 +63,10 @@ export const ViewPage = () => {
|
|||||||
type: item.typ,
|
type: item.typ,
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
})),
|
}),
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
cnt: data.cnt
|
cnt: data.cnt
|
||||||
}
|
})
|
||||||
|
|
||||||
|
|
||||||
parseData.items = parseData.items.map((question:any) => {
|
parseData.items = parseData.items.map((question:any) => {
|
||||||
|
@ -1,30 +1,35 @@
|
|||||||
export const replaceSpacesToEmptyLines = <T = unknown>(object: T): T => {
|
export const replaceSpacesToEmptyLines = <T = unknown>(object: T): T => {
|
||||||
if (Array.isArray(object)) {
|
if (Array.isArray(object)) {
|
||||||
return object.map(replaceSpacesToEmptyLines) as T;
|
return object.map(replaceSpacesToEmptyLines) as T;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!object || typeof object !== "object") {
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
const result: Record<string, unknown> = {};
|
||||||
|
|
||||||
|
for (const [key, value] of Object.entries(object)) {
|
||||||
|
if (typeof value === "string") {
|
||||||
|
result[key] = value.replace(/\" \"/g, '""');
|
||||||
|
// ↓ ЭТО ВРЕМЕННЫЙ КОД ДЛЯ ДЕМОНСТРАЦИИ ДИМЕ
|
||||||
|
result[key] = value.replace(
|
||||||
|
"squiz.pena.digital",
|
||||||
|
"storage.yandexcloud.net"
|
||||||
|
);
|
||||||
|
// ↑ ЭТО ВРЕМЕННЫЙ КОД ДЛЯ ДЕМОНСТРАЦИИ ДИМЕ
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!object || typeof object !== "object") {
|
if (typeof value === "object") {
|
||||||
return object;
|
result[key] = replaceSpacesToEmptyLines(value);
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result: Record<string, unknown> = {};
|
result[key] = value;
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(object)) {
|
|
||||||
if (typeof value === "string") {
|
return result as T;
|
||||||
result[key] = value.replace(/\" \"/g, '""');
|
};
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof value === "object") {
|
|
||||||
result[key] = replaceSpacesToEmptyLines(value);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result as T;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user