chore: refactor getPersistedTables

This commit is contained in:
Marc-Roig 2023-04-18 17:17:58 +02:00
parent 8ba81e5c87
commit 8da6342bde

View File

@ -92,13 +92,15 @@ async function removePersistedTables({ strapi }, tableNames) {
* @param {Strapi} ctx.strapi
* @returns {Promise<string[]>}
*/
const getPersistedTables = async ({ strapi }) =>
(
await strapi.store.get({
type: 'core',
key: 'persisted_tables',
})
).map(transformTableName) ?? [];
async function getPersistedTables({ strapi }) {
const persistedTables = await strapi.store.get({
type: 'core',
key: 'persisted_tables',
});
return (persistedTables || []).map(transformTableName);
}
/**
* Add all table names that start with a prefix to the reserved tables in