mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-14 16:49:10 +00:00
fix(api): sync from legacy used wrong type of data
This commit is contained in:
parent
bfc96b0750
commit
117c73a8a1
2 changed files with 9 additions and 6 deletions
|
@ -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,
|
||||
})
|
||||
),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue