Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Oct 25, 2023
1 parent 7510a96 commit 4bf08d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/adapters/supabase/helpers/tables/wallet.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import dotenv from "dotenv";
dotenv.config();

import { Context } from "probot";
import { Context as ProbotContext } from "probot";
import { createAdapters } from "../../..";
import { loadConfig } from "../../../../bindings/config";
import { User } from "../../../../types";
import { Context, User } from "../../../../types";
const SUPABASE_URL = process.env.SUPABASE_URL;
if (!SUPABASE_URL) throw new Error("SUPABASE_URL is not defined");
const SUPABASE_KEY = process.env.SUPABASE_KEY;
if (!SUPABASE_KEY) throw new Error("SUPABASE_KEY is not defined");

const mockContext = { supabase: { url: SUPABASE_URL, key: SUPABASE_KEY } } as unknown as Context;
const mockContext = { supabase: { url: SUPABASE_URL, key: SUPABASE_KEY } } as unknown as ProbotContext;

async function getWalletAddressAndUrlTest(context: Context) {
const botConfig = await loadConfig(context);
const { wallet } = createAdapters(botConfig).supabase;
async function getWalletAddressAndUrlTest(eventContext: ProbotContext) {
const botConfig = await loadConfig(eventContext);
const context: Context = { event: eventContext, config: botConfig };
const { wallet } = createAdapters(context).supabase;
const userId = 4975670 as User["id"];
const results = [] as unknown[];
try {
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/pricing/pricing-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export async function pricingLabel(context: Context) {
const minTimeLabel = sortLabelsByValue(recognizedTimeLabels).shift();
const minPriorityLabel = sortLabelsByValue(recognizedPriorityLabels).shift();

if (!minTimeLabel) return logger.warn(`No time label to calculate price`);
if (!minPriorityLabel) return logger.warn("No priority label to calculate price");
if (!minTimeLabel) throw logger.warn(`No time label to calculate price`);
if (!minPriorityLabel) throw logger.warn("No priority label to calculate price");

const targetPriceLabel = setPrice(context, minTimeLabel, minPriorityLabel);

Expand Down

0 comments on commit 4bf08d2

Please sign in to comment.