Skip to content

Commit

Permalink
Changes according to CR
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-neti committed Jun 18, 2024
1 parent 0d73bff commit eb0449d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/bot/checkApplications.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getApiClients } from "../services/filplusService";
import {
getAllocatorsWithSSABotEnable,
getAllocatorsWithSSABotEnabled,
getApplications,
postApplicationRefill,
postApplicationTotalDCReached,
Expand Down Expand Up @@ -39,7 +39,7 @@ export const checkApplications = async (): Promise<void> => {
data: allocators,
error: allocatorsError,
success: allocatorSuccess,
} = await getAllocatorsWithSSABotEnable();
} = await getAllocatorsWithSSABotEnabled();
if (!allocatorSuccess) {
logError(`Get Allocators Error: ${allocatorsError}`);
}
Expand Down
17 changes: 9 additions & 8 deletions src/services/backendService.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import axios from "axios";
import { config } from "../config";
import { logDebug } from "../utils/consoleLogger";
import {
type RequestAllocatorsReturn,
type RequestApplicationsReturn,
type RequestApplicationReturn,
type Application,
type RequestAllowanceReturn,
import type {
RequestAllocatorsReturn,
RequestApplicationsReturn,
RequestApplicationReturn,
Application,
RequestAllowanceReturn,
Allocator,
} from "../types/types";

/**
* Gets all the allocators from the backend
*
* @returns {Promise<RequestAllocatorsReturn>} The list of allocators
*/
export const getAllocatorsWithSSABotEnable =
export const getAllocatorsWithSSABotEnabled =
async (): Promise<RequestAllocatorsReturn> => {
logDebug(`Requesting allocators from backend`);
try {
Expand All @@ -23,7 +24,7 @@ export const getAllocatorsWithSSABotEnable =
url: `${config.backendApi}/allocators`,
});
const allocatorsWithSSABotEnable = response.data.filter(
(allocator) => allocator.disable_ssa_bot !== true,
(allocator: Allocator) => !allocator.disable_ssa_bot,
);
return {
data: allocatorsWithSSABotEnable,
Expand Down
1 change: 1 addition & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export interface Allocator {
installation_id: number;
multisig_address: string;
verifiers_gh_handles: string;
disable_ssa_bot: boolean;
}

export interface RequestAllocatorsReturn {
Expand Down

0 comments on commit eb0449d

Please sign in to comment.