Skip to content

Commit

Permalink
Refactoring types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiglesias93 committed Mar 25, 2021
1 parent 25e2321 commit 699eea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/handlers/saveConsent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { corsHeaders } from '../utils/constants';
import { EndpointPayload } from '../utils/types';

const storeConsents = async (request: Request): Promise<Response> => {
const { id, action, url, userAgent, consents, bannerText }: EndpointPayload = await request.json();
Expand Down
18 changes: 8 additions & 10 deletions src/utils/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
export interface Consents {
uncategorized: boolean;
essential: boolean;
personalization: boolean;
analytics: boolean;
marketing: boolean;
}

export interface EndpointPayload {
interface EndpointPayload {
id: string;
action: string;
url: string;
userAgent: string;
consents: Consents;
bannerText: string;
consents: {
uncategorized: boolean;
essential: boolean;
personalization: boolean;
analytics: boolean;
marketing: boolean;
};
}

0 comments on commit 699eea1

Please sign in to comment.