normalized scaffold indexes
This commit is contained in:
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<!-- prism -->
|
<!-- prism -->
|
||||||
<script src="./libs/prism/prism.js" data-manual></script>
|
<script src="./libs/prism/prism.js" data-manual></script>
|
||||||
<script type="module" crossorigin src="./assets/index-CphO81V5.js"></script>
|
<script type="module" crossorigin src="./assets/index-_S-h6ORT.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-DRWtZ-mO.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-DRWtZ-mO.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -180,6 +180,11 @@ function collectionUpsertModal(rawCollection, modalSettings) {
|
|||||||
|
|
||||||
const rawCollection = JSON.stringify(await request);
|
const rawCollection = JSON.stringify(await request);
|
||||||
|
|
||||||
|
// manually reload scaffolds to ensure that followup collections would have up-to-date clean state
|
||||||
|
app.store.collectionScaffolds = await app.pb.collections.getScaffolds({
|
||||||
|
requestKey: "save.reloadScaffolds",
|
||||||
|
});
|
||||||
|
|
||||||
data.originalCollection = JSON.parse(rawCollection);
|
data.originalCollection = JSON.parse(rawCollection);
|
||||||
data.collection = JSON.parse(rawCollection);
|
data.collection = JSON.parse(rawCollection);
|
||||||
app.store.addOrUpdateCollection(JSON.parse(rawCollection));
|
app.store.addOrUpdateCollection(JSON.parse(rawCollection));
|
||||||
@@ -770,6 +775,11 @@ function syncFieldsAndIndexesWithScaffold(collection) {
|
|||||||
|
|
||||||
// merge new scaffold indexes
|
// merge new scaffold indexes
|
||||||
app.utils.mergeUnique(collection.indexes, newScaffold.indexes);
|
app.utils.mergeUnique(collection.indexes, newScaffold.indexes);
|
||||||
|
|
||||||
|
// ensure that all indexes reference the latest colection name
|
||||||
|
collection.indexes = collection.indexes?.map((idx) => {
|
||||||
|
return app.utils.replaceIndexFields(idx, { tableName: collection.name || "" });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function truncateDropdownItem(data, modalSettings) {
|
function truncateDropdownItem(data, modalSettings) {
|
||||||
|
|||||||
Reference in New Issue
Block a user