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