Skip to content

Commit

Permalink
changed dynamoDB to use N-type as partition key
Browse files Browse the repository at this point in the history
  • Loading branch information
zvoverman committed May 25, 2024
1 parent 6ac1cf7 commit 359c84b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { useQueryClient, QueryClient, QueryClientProvider, useQuery } from 'react-query';
import { QueryClient, QueryClientProvider, useQuery } from 'react-query';
import './App.css';
import PersonCard from './PersonCard';
import ToggleButton from 'react-bootstrap/ToggleButton';
Expand All @@ -8,7 +8,7 @@ import ToggleButtonGroup from 'react-bootstrap/ToggleButtonGroup';
const queryClient = new QueryClient();

interface CharacterData {
id: string;
id: number;
name: string;
height: string;
mass: string;
Expand Down Expand Up @@ -46,7 +46,7 @@ function GetPeople() {
// Updates the local favorites list
useEffect(() => {
if (data) {
setFavoriteCards(data.map(person => parseInt(person.id)));
setFavoriteCards(data.map(person => person.id));
}
}, [data]);

Expand Down
4 changes: 2 additions & 2 deletions src/components/PersonCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PersonCardProps {
}

interface CharacterData {
id: string;
id: number;
name: string;
height: string;
mass: string;
Expand All @@ -20,7 +20,7 @@ interface CharacterData {
}

const addPerson = async (id: number, data: CharacterData): Promise<CharacterData> => {
data.id = id.toString();
data.id = id;
const response = await fetch(`https://w5c9dy2dg4.execute-api.us-east-2.amazonaws.com/people`, {
method: 'PUT',
headers: {
Expand Down

0 comments on commit 359c84b

Please sign in to comment.