mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 01:13:48 +01:00
Refactoring
This commit is contained in:
parent
6b9f01de7f
commit
d5e7a062b8
@ -20,18 +20,13 @@ export default (user: ILocalUser, url: string, object: any) => new Promise((reso
|
||||
method: 'POST',
|
||||
path: pathname + search,
|
||||
}, res => {
|
||||
res.on('end', () => {
|
||||
log(`${url} --> ${res.statusCode}`);
|
||||
log(`${url} --> ${res.statusCode}`);
|
||||
|
||||
if (res.statusCode >= 200 && res.statusCode < 300) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(res);
|
||||
}
|
||||
});
|
||||
|
||||
res.on('data', () => {});
|
||||
res.on('error', reject);
|
||||
if (res.statusCode >= 400) {
|
||||
reject();
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
sign(req, {
|
||||
|
Loading…
Reference in New Issue
Block a user