Improve emoji-picker (#5515)
* Improve emoji-picker * remove unimplanted translation * カテゴリのサジェスト * use unique
This commit is contained in:
@ -26,6 +26,10 @@ export const meta = {
|
||||
validator: $.str.min(1)
|
||||
},
|
||||
|
||||
category: {
|
||||
validator: $.optional.str
|
||||
},
|
||||
|
||||
aliases: {
|
||||
validator: $.optional.arr($.str.min(1)),
|
||||
default: [] as string[]
|
||||
@ -52,6 +56,7 @@ export default define(meta, async (ps, me) => {
|
||||
id: genId(),
|
||||
updatedAt: new Date(),
|
||||
name: ps.name,
|
||||
category: ps.category,
|
||||
host: null,
|
||||
aliases: ps.aliases,
|
||||
url: ps.url,
|
||||
|
@ -23,12 +23,19 @@ export const meta = {
|
||||
|
||||
export default define(meta, async (ps) => {
|
||||
const emojis = await Emojis.find({
|
||||
host: toPunyNullable(ps.host)
|
||||
where: {
|
||||
host: toPunyNullable(ps.host)
|
||||
},
|
||||
order: {
|
||||
category: 'ASC',
|
||||
name: 'ASC'
|
||||
}
|
||||
});
|
||||
|
||||
return emojis.map(e => ({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
category: e.category,
|
||||
aliases: e.aliases,
|
||||
host: e.host,
|
||||
url: e.url
|
||||
|
@ -25,6 +25,10 @@ export const meta = {
|
||||
validator: $.str
|
||||
},
|
||||
|
||||
category: {
|
||||
validator: $.optional.str
|
||||
},
|
||||
|
||||
url: {
|
||||
validator: $.str
|
||||
},
|
||||
@ -53,6 +57,7 @@ export default define(meta, async (ps) => {
|
||||
await Emojis.update(emoji.id, {
|
||||
updatedAt: new Date(),
|
||||
name: ps.name,
|
||||
category: ps.category,
|
||||
aliases: ps.aliases,
|
||||
url: ps.url,
|
||||
type,
|
||||
|
Reference in New Issue
Block a user