mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
chore: refactor getPersistedTables
This commit is contained in:
parent
8ba81e5c87
commit
8da6342bde
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user