mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-06-04 09:03:50 -04:00
Swap indexOf to includes when indexOf was just being used to check if an item was in an array
This commit is contained in:
@@ -11,7 +11,7 @@ export const apiChannelManageActive = async (query: Map<string, string>, apiUser
|
||||
erroredOut = false;
|
||||
|
||||
// Determine value to set
|
||||
if (path.toLowerCase().indexOf('de') > 0) {
|
||||
if (path.toLowerCase().includes('de')) {
|
||||
value = 0;
|
||||
} else {
|
||||
value = 1;
|
||||
|
||||
@@ -12,7 +12,7 @@ export const apiChannelManageBan = async (query: Map<string, string>, apiUserid:
|
||||
erroredOut = false;
|
||||
|
||||
// Determine value to set
|
||||
if (path.toLowerCase().indexOf('un') > 0) {
|
||||
if (path.toLowerCase().includes('un')) {
|
||||
value = 0;
|
||||
} else {
|
||||
value = 1;
|
||||
|
||||
@@ -13,14 +13,14 @@ export const apiKeyManage = async (query: Map<string, string>, apiUserid: bigint
|
||||
erroredOut = false;
|
||||
|
||||
// Determine key to edit
|
||||
if (path.toLowerCase().indexOf('ban') > 0) {
|
||||
if (path.toLowerCase().includes('ban')) {
|
||||
key = 'banned';
|
||||
} else {
|
||||
key = 'active';
|
||||
}
|
||||
|
||||
// Determine value to set
|
||||
if (path.toLowerCase().indexOf('de') > 0 || path.toLowerCase().indexOf('un') > 0) {
|
||||
if (path.toLowerCase().includes('de') || path.toLowerCase().includes('un')) {
|
||||
value = 0;
|
||||
} else {
|
||||
value = 1;
|
||||
|
||||
Reference in New Issue
Block a user