More puny
This commit is contained in:
parent
72a5f7b1e2
commit
236d72685d
14 changed files with 52 additions and 55 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import $ from 'cafy';
|
||||
import define from '../../../define';
|
||||
import { Instances } from '../../../../../models';
|
||||
import { toPuny } from '../../../../../misc/convert-host';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
|
@ -20,13 +21,13 @@ export const meta = {
|
|||
};
|
||||
|
||||
export default define(meta, async (ps, me) => {
|
||||
const instance = await Instances.findOne({ host: ps.host });
|
||||
const instance = await Instances.findOne({ host: toPuny(ps.host) });
|
||||
|
||||
if (instance == null) {
|
||||
throw new Error('instance not found');
|
||||
}
|
||||
|
||||
Instances.update({ host: ps.host }, {
|
||||
Instances.update({ host: toPuny(ps.host) }, {
|
||||
isMarkedAsClosed: ps.isClosed
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue