Skip to content

Commit

Permalink
refactor: remove duplicated types
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Nov 12, 2023
1 parent b8dfc1e commit c020780
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/components/modals/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ interface Props {
setError: ErrorHandlerType;
}

type SettingsPayload = { [key: string]: string };

Check failure on line 56 in src/components/modals/SettingsModal.tsx

View workflow job for this annotation

GitHub Actions / build (v18.16.0)

'SettingsPayload' is already defined

const backend = new Backend();

function SettingsModal({
Expand Down
5 changes: 3 additions & 2 deletions src/lib/backend/Backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import Jobs, { JobsId } from '../../schemas/public/Jobs';
import { ConnectionInfo } from '../interfaces/ConnectionInfo';
import isOfflineMode from '../isOfflineMode';
import getObjectIcon, { ObjectIcon } from '../notion/getObjectIcon';
import { Rules, Settings } from '../types';
import { del, get, getLoginURL, post } from './api';
import { getResourceUrl } from './getResourceUrl';
import { OK } from './http';
import Settings from '../../schemas/public/Settings';
import ParserRules from '../../schemas/public/ParserRules';

export class Backend {
baseURL: string;
Expand Down Expand Up @@ -73,7 +74,7 @@ export class Backend {
return post(`${this.baseURL}rules/create/${id}`, { payload });
}

async getRules(id: string): Promise<Rules | null> {
async getRules(id: string): Promise<ParserRules | null> {
try {
const findRules = async () => get(`${this.baseURL}rules/find/${id}`);
const result = await findRules();
Expand Down
19 changes: 0 additions & 19 deletions src/lib/types.ts

This file was deleted.

0 comments on commit c020780

Please sign in to comment.