fix(api): sync from legacy used wrong type of data

This commit is contained in:
41666 2021-03-21 22:10:27 -04:00
parent bfc96b0750
commit 117c73a8a1
2 changed files with 9 additions and 6 deletions

View file

@ -44,11 +44,13 @@ export const transformLegacyGuild = (guild: LegacyGuildData): GuildData => {
id: guild.id,
message: guild.message,
features: Features.LegacyGuild,
categories: sortBy(guild.categories, 'position').map((category, idx) => ({
...category,
id: KSUID.randomSync().string,
position: idx, // Reset positions by index. May have side-effects but oh well.
type: category.type === 'multi' ? CategoryType.Multi : CategoryType.Single,
})),
categories: sortBy(Object.values(guild.categories), 'position').map(
(category, idx) => ({
...category,
id: KSUID.randomSync().string,
position: idx, // Reset positions by index. May have side-effects but oh well.
type: category.type === 'multi' ? CategoryType.Multi : CategoryType.Single,
})
),
};
};

View file

@ -7,6 +7,7 @@ module.exports = {
'BOT_CLIENT_ID',
'BOT_CLIENT_SECRET',
'BOT_TOKEN',
'BOT_IMPORT_TOKEN',
'UI_PUBLIC_URI',
'API_PUBLIC_URI',
'ROOT_USERS',