0:00:17
what's going on guys welcome back to
0:00:20
another session of buildbreaking fixed
0:00:25
the exclusive raw coders
0:00:28
and yes that ah seems tories having a
0:00:40
all right it's my it's my other monitor
0:00:43
it's being weird oh
0:00:49
yeah oh you can hear it
0:00:54
it's not your fault
0:00:56
it's just a tactful it's microsoft's
0:01:06
tory time to convert to apple
0:01:09
talented convert to apple
0:01:18
tourism like i'll i'll prefer to hear
0:01:22
this noise again and again then convert
0:01:32
all right code police i hear i'm code
0:01:38
thanks for joining
0:01:40
welcome confirm 64.
0:01:44
yeah so just uh before further ado
0:01:48
let's do the acknowledgement of the
0:01:49
country and pay our respects to the
0:01:52
elders of the past present and upcoming
0:01:55
let's have a go at that
0:02:00
i begin today by acknowledging the
0:02:02
traditional custodians of the land on
0:02:04
which we gather today and pay my
0:02:06
respects to the elders past present and
0:02:09
future i extend their respect to
0:02:12
aboriginal and torres strait islander
0:02:22
tori if you want to choose a letter
0:02:32
quickly quick for dory
0:02:47
oh okay yeah here we go
0:02:50
because that's the closest one
0:02:52
how about if we pick the
0:02:55
how about if you pick the second
0:02:59
if that's come up a bit too many times
0:03:03
this is a rock show um
0:03:12
elven all right there we go what does
0:03:35
that is interesting for sure
0:03:38
i don't even know what to make of it
0:03:44
shall we just see the rock
0:03:48
whatever you want this is fine with me
0:03:49
it's kind of weird
0:03:52
i don't know i know
0:03:54
all right there you go maybe maybe a
0:03:56
feel after you drank a coke
0:04:04
all right nevermind
0:04:06
um so yeah just a bit of a progress uh
0:04:09
from yesterday so we did um
0:04:14
a bit of a old team team member cartier
0:04:21
he was just there to as in
0:04:24
um see how far we've been
0:04:26
going and just okay you catch up
0:04:29
and um so today what we're going to be
0:04:32
basically doing in
0:04:36
moving on to implementing the passcode
0:04:40
which means that um
0:04:45
in the front end we won't be showing the
0:04:51
but for that to do we would have to fix
0:04:54
up one comment because if you remember
0:04:57
to read them when we did the
0:05:02
and there one of the comments
0:05:08
let's do that first
0:05:10
so i'm going to share my screen because
0:05:14
um you still got that
0:05:20
uh i'll have to check so i'll do a
0:05:24
excuse me i'm drinking coke
0:05:26
and the only reason why is minor youtube
0:05:29
drinks are finished and i needed a bit
0:05:31
of caffeine so this was the only source
0:05:33
of caffeine that i could think of
0:05:37
moment which is something is better
0:05:46
it's cold coffee cold tea
0:05:56
cold coffee i'm not into the cold coffee
0:06:01
as in this is i find it weird
0:06:07
i feel it as in coffee has gone
0:06:10
coffee was hot but it's been out there
0:06:13
there for hours and hours and it's been
0:06:15
cold now and i'm sorry
0:06:18
you're talking about
0:06:19
lukewarm coffee or room temperature
0:06:22
coffee i'm talking about
0:06:24
you get some ice cubes
0:06:27
and you put it in your coffee like
0:06:35
i think that ice cube coffee is that
0:06:38
lukewarm coffee as in
0:06:41
that's how my mindset works
0:06:44
that's why i don't drink
0:06:49
coffee which is cold person personal
0:06:55
all right cool so i'll share my screen
0:06:57
we agree to disagree
0:07:01
personal preferences
0:07:07
hey i mean fly here so
0:07:13
i'm being as polite as i can be about
0:07:18
okay so i'll go back into the scrumbler
0:07:25
and scramble enhancement
0:07:38
all right cool so what were the changes
0:07:41
it was we basically reverted
0:07:44
the forms thing back isn't it
0:07:52
there was like a commit that you had
0:08:00
and i think it was some styling
0:08:02
and maybe some other stuff
0:08:05
but i don't i don't know all that if you
0:08:07
do a get pull then yeah i've done it oh
0:08:12
now it's gonna be harder
0:08:17
we will figure this out
0:08:24
it's going to be another get episode
0:08:26
well i'm going to learn
0:08:30
not but if it is we get to live we got
0:08:37
definitely knows what they're doing
0:08:44
live server so okay cool so if i press
0:08:48
anything just board
0:08:55
okay so we're pretty much back into
0:08:59
where we were right
0:09:01
which is brilliant because this is
0:09:06
i guess so yeah i don't
0:09:08
uh what does that say
0:09:11
it says board already exists or
0:09:13
incorrect passcode
0:09:15
cool which is fine
0:09:18
so all we basically have
0:09:21
to do is implement the get functionality
0:09:26
by not passing in the passcodes
0:09:30
in the front end that's already
0:09:32
isn't it am i right
0:09:39
yeah yeah yeah yeah you mean
0:09:41
the back end doesn't send the passcodes
0:09:46
backhand isn't supposed to send the
0:09:48
pause code to the front end
0:09:51
so basically what we would need to do is
0:09:55
that was implemented in the still front
0:10:03
but the past the password
0:10:06
so there's there must be a path on the
0:10:10
on the in the express app
0:10:12
the serverless express app
0:10:15
yeah where you're getting the boards but
0:10:17
it's giving back too much information so
0:10:23
so i think we just need to
0:10:28
whatever's getting queried
0:10:30
from dynamodb and getting sent back to
0:10:38
so basically what we need to change
0:10:50
yeah here we go and we just need to
0:10:53
basically change and get rid of this
0:10:57
boom okay simple yeah
0:11:02
like a senior deaf at the moment
0:11:05
really pinpointing carrier then now it's
0:11:15
okay that one is done board name which
0:11:22
i think in the future too
0:11:25
do we have a gsi with just the board
0:11:32
we must have it because
0:11:34
i'm usually somewhere else right
0:11:37
yeah we are choosing it because it is in
0:11:42
unless it's been removed
0:11:45
so we could put a to-do there where in
0:11:51
you could just scan the index
0:11:53
instead of scanning the
0:11:58
because i think it will be
0:12:00
a little bit more performant to scan the
0:12:02
index i'm guessing
0:12:05
okay i don't i don't know about that
0:12:07
first for sure and for certain but i
0:12:10
know there's less attributes
0:12:13
to scan and i don't know if that helps
0:12:15
the performance or not it could be
0:12:19
yes uh i i don't know about that because
0:12:23
i already dealt that much with the in
0:12:26
indexes with dynamodb but you must be
0:12:30
and if not we can always do our research
0:12:34
find out what is the right information
0:12:37
but um if you don't mind putting that um
0:12:41
uh task in jira so we can
0:12:45
come back i mean yeah it's like uh later
0:12:57
let's build it and then deploy it and
0:12:59
then in that way we can work off
0:13:03
and then go back to our we'll get both
0:13:21
how'd your day been though
0:13:24
pretty good yeah pretty good day uh it
0:13:26
was nice i coded i napped i went out for
0:13:30
nice one took a nice walk
0:13:35
it's a nice day if i can take a nap it's
0:13:41
i can i can tell how much
0:13:43
better you than now
0:13:45
i do that is like uh
0:13:48
that is a must if i'm gonna have a nice
0:13:51
day it includes an app
0:13:59
keeping the uh keeping the money at and
0:14:07
is really good because then they can
0:14:09
perform when you need them to perform
0:14:18
uh still got a long way to go man
0:14:27
i am actually really passionate about as
0:14:36
knowing how human brain works
0:14:39
yeah i gave up on that
0:14:43
it's too complicated
0:14:45
uh yeah it's pretty messy so i just just
0:14:54
but i can do what i need you to do
0:14:56
that's all i need isn't it
0:15:02
we are back in the front end
0:15:07
we would basically
0:15:10
what's gonna happen now is that we have
0:15:21
i need to get pulled this as well
0:15:27
i bought oh have i already done this
0:15:30
looks like there is one
0:15:32
what's what's in your do you have a
0:15:35
change to commit or something
0:15:39
your git is lit up yeah
0:15:43
console board names oh that was just
0:15:48
checking when to do that yeah
0:15:50
gotcha so i don't really need that
0:15:53
board names born name array
0:15:57
ah interesting i would need this code
0:16:04
and then i can just use the the one
0:16:07
okay cool we can undo this
0:16:14
and then go in there
0:16:19
okay cool so passcode
0:16:22
yeah we are sending the passcode yeah
0:16:40
board name passcode yeah and i want to
0:16:42
go into this method
0:16:45
and this is the board names yeah there
0:16:48
we go okay cool so we are back on track
0:16:54
um so how do we wanna compare it
0:16:58
so when we press the get board
0:17:06
here you will get all the board names
0:17:16
and that's what currently happens right
0:17:19
and then if it'll throw that it'll show
0:17:24
that little toast message
0:17:27
yes already exists
0:17:30
on that you want something to change
0:17:34
um i want the pos code to be checked as
0:17:38
well so for that one it would have to go
0:17:41
to the db every time
0:17:49
all right so we need to implement that
0:17:59
the back end we are already having
0:18:02
that sort of thing where
0:18:11
where we are getting
0:18:18
uh by the way i'm just
0:18:22
trying to work a bit more into
0:18:26
of front end because i did actually
0:18:31
realize them my back end is stronger
0:18:34
than my front hand as in
0:18:38
excuse wise i like how you say that
0:18:41
yeah just kill them
0:18:49
so yeah coke is really working to be
0:18:55
yeah well you know we're always gonna
0:18:58
like wherever we spend our time more is
0:19:01
generally just gonna be where you're
0:19:03
more proficient you know
0:19:09
wooden names got a comment
0:19:14
yeah uh convar says
0:19:18
you gotta keep that back end strong
0:19:28
um i'm trying to keep a balance here as
0:19:33
well but yeah i would say my my kind of
0:19:40
more strengths are
0:19:52
all right okay cool so
0:19:55
here we are coming
0:19:57
here so we'll gain the board names
0:20:14
so where does this function get called
0:20:18
it gets called over front when you're
0:20:28
so what's what happens after that
0:20:32
so because here we are only
0:20:34
kind of returning oh come on
0:20:37
where's the other one at the window
0:20:41
i really have to change
0:20:43
my setup of this thing a bit
0:20:48
okay cool so you know how this board
0:20:56
this is being called here
0:21:00
well that's that's where it's declared
0:21:02
but i mean where is it
0:21:08
like where is this where is this
0:21:10
function being executed i guess is what
0:21:23
creating a new board it gets all the
0:21:25
board names and then checks if the
0:21:28
current board name is in this board name
0:21:33
and then it returns and opens the alert
0:21:36
so do you want to use that
0:21:40
so yeah what do you want to do you want
0:21:42
to send the passcode with the post board
0:21:45
name there on line 28
0:21:52
was thinking because we are not
0:21:55
bringing the passcodes in the front end
0:22:00
so we basically have to still send on
0:22:07
uh i mean we're already checking the
0:22:10
board names okay which is fine but to
0:22:14
check the passcode if it's a valid
0:22:16
passcode for this board board name
0:22:19
we need to go in the database
0:22:22
for example in the back end to check if
0:22:25
this passcode is actually the right
0:22:32
which actually brings me to my
0:22:37
so we can basically do a check
0:22:42
so you want to send the passcode with
0:22:45
get board names requests
0:22:49
is that what you're saying
0:22:52
i want to send a passcode with this
0:22:56
get bored names request yes yes
0:22:59
and then in the back end it will
0:23:08
as in it would hit the database check if
0:23:11
the board pass code is is present of the
0:23:14
board name if it is the right one
0:23:17
in the back end it will do the valid
0:23:22
it would depending on the results it
0:23:25
would return either true or false
0:23:28
and then and then what happens after
0:23:30
that in the front end and then
0:23:33
what happens off in the in the front end
0:23:35
is it guess the result there is a valid
0:23:39
board and passcode which is true
0:23:43
then it would just
0:23:45
get the passcode and get the entire
0:23:54
what happens to the alert
0:23:56
then what happens to the alert how do we
0:23:58
wait a minute i guess i'm just confused
0:24:00
about what what should happen
0:24:06
explaining it to broad
0:24:11
going in the logical steps
0:24:15
i guess one more thing too before you
0:24:18
continue if you don't mind is then do we
0:24:20
even need to get the board names because
0:24:23
what are we doing with the board names
0:24:25
now because if you're just
0:24:27
entering a board name
0:24:31
you're sending the passcode
0:24:33
with it aren't you just checking
0:24:35
anyways to see if that board exists
0:24:39
do we even need to get the board names
0:24:43
so we're just gonna get good point so
0:24:45
we're just gonna get rid of the whole
0:24:47
alert like the alert box
0:24:50
no so we won't get rid of that in the
0:24:55
so there are two kinds of
0:25:09
of the board and the passcode all in the
0:25:15
so we don't even even have to rely on
0:25:19
the board names coming in the front end
0:25:23
and then do all the
0:25:25
validation of board name and password in
0:25:29
then depending on the
0:25:31
results pass it true or
0:25:35
return true or false and then just pass
0:25:39
to the front tense
0:25:41
saying if it's a valid one or not
0:25:44
so if it is then it will be true if it's
0:25:48
not it will be false
0:25:54
re you and we show that alert box
0:25:57
depending on if it's false
0:26:02
so you're gonna change the alert message
0:26:06
this board already exists and or the
0:26:10
password is invalid the passcode
0:26:17
doesn't exist then it would just
0:26:21
create create a new board yeah okay
0:26:27
after the after that
0:26:29
i guess just thinking forward
0:26:33
so let's say you enter the right board
0:26:36
name and the right passcode
0:26:38
it's going to return
0:26:44
or something then it's going to redirect
0:26:47
you to that boards page
0:26:56
or it's gonna it's not gonna redirect
0:26:58
you but well whatever it's gonna it's
0:27:00
gonna send you to the boards page on the
0:27:07
now when you're on that page
0:27:10
you're gonna have to enter your passcode
0:27:12
again because we don't have like a
0:27:16
a session or something or some token
0:27:19
to say the person is authenticated
0:27:26
um why would we have to enter the
0:27:29
passcode on the boost page now well
0:27:32
because i could just go to the url and
0:27:33
then it'll show the
0:27:37
don't you want admin privileges
0:27:40
i want admin privileges for only the
0:27:44
so if i just have a
0:27:46
so if i just have a url of a board and i
0:27:50
just go to it do i need to enter the
0:28:01
i'm thinking uh i'm thinking
0:28:05
though awful too far
0:28:09
real but talking about that scenario yes
0:28:12
typically we should have a passcode for
0:28:16
that board because it would
0:28:19
you wouldn't want anyone want to just
0:28:21
access anyone else's data
0:28:24
so then yeah so that goes back to the
0:28:27
thing is like when you get redirected
0:28:33
so you're gonna get redirected to a new
0:28:35
page the boards page when you enter the
0:28:40
but then when you land on the board page
0:28:42
there's gonna be some other type of
0:28:45
validation that needs to happen again to
0:28:48
say hey the person who came to this page
0:28:51
is the authenticated person but we don't
0:28:54
have a token or anything like that
0:28:56
for a session or a cookie
0:29:01
we have no way of knowing that the
0:29:02
person who came from
0:29:04
who just entered the correct passcode on
0:29:07
the front end or the the homepage
0:29:10
is the same person
0:29:15
redirected you know what i'm saying
0:29:17
yes i understand exactly what you're
0:29:22
um i don't know if you had a look at how
0:29:27
scrambler app is working
0:29:30
but in that one even if that there's
0:29:33
someone else's board
0:29:35
and we type in that board we can still
0:29:38
see that data so considering that we are
0:29:42
doing the mvp at this stage
0:29:46
oh sorry i just got confused because i
0:29:49
the boards would be
0:29:51
password protected from viewing
0:30:06
confused do you want us so did i say
0:30:10
that the boards are uh so
0:30:13
say for example you have created a board
0:30:16
and you have saved it but if i wanna as
0:30:19
in visit that board from directly from
0:30:29
we shouldn't need a pass a passcode for
0:30:33
you shouldn't you don't it's public yeah
0:30:40
so i'm not really understanding with a
0:30:45
your understanding or my
0:30:47
uh oh i just i thought you said earlier
0:30:51
the boards are not public like you need
0:30:53
to have a passcode
0:30:55
password to view the boards
0:30:58
i thought that's what you said so i
0:31:01
guess i just okay um i
0:31:08
that would be potentially the case in
0:31:13
because that behavior is isn't really
0:31:16
happening in the original
0:31:19
scrambler that we are
0:31:21
kind of working on enhancing
0:31:26
i would say that that thing would be the
0:31:31
functionality in in the very near future
0:31:34
of to the mvp is done and you're right i
0:31:40
say that but for the
0:31:41
um future plans gotcha so viewing is
0:31:45
public all boards are able like you can
0:31:48
see all the notes everything that's
0:31:49
public but to change like to save
0:31:54
the board you need the passcode right so
0:31:56
that's something we'll implement later
0:31:58
like if you're on the boards page and
0:32:01
you click the save button then you need
0:32:05
to have a passcode right
0:32:18
cool uh but there's one more thing the
0:32:22
hasn't created the passcode
0:32:26
he won't be able to see the save button
0:32:30
but that one is off to the mvp
0:32:35
i guess yeah because you would need you
0:32:37
would need roles in the database or
0:32:44
signed in and they're the admin and
0:32:47
on the front end show them the
0:32:49
show them the save button
0:32:54
yeah right absolutely or
0:32:59
yeah i mean there's other
0:33:01
hackier ways of doing it
0:33:04
but yeah whatever um it's cool
0:33:07
you could have like a sign in button too
0:33:10
on the on the board page
0:33:13
that basically like if you sign in then
0:33:16
the button will show up
0:33:24
yes and again they
0:33:37
everything and those are the future
0:33:47
i think we should only focus on the mvp
0:33:54
yeah yeah it sounds good i was uh i
0:33:55
didn't mean to side track i was just
0:34:02
thought process about what would be the
0:34:05
next steps with what we're gonna do with
0:34:07
the api to make sure
0:34:13
like i guess make sense
0:34:16
or whatever like what we were gonna code
0:34:18
yeah i get it now it makes total sense
0:34:26
so you're not guessing
0:34:28
by the way am i not
0:34:30
no i don't know what happened ah i need
0:34:33
to share my screen okay cool so
0:34:45
but that was already open yeah it's
0:34:49
so basically what we
0:34:56
get board functionality
0:34:58
um we are comparing board
0:35:03
names in the front already
0:35:18
then what we need to do is
0:35:43
and based on the results
0:35:59
does this make sense
0:36:03
yeah where so where are we where are we
0:36:05
passing in the back
0:36:08
passcode now in there
0:36:14
going to go in the
0:36:23
looks like it's in here
0:36:28
we should only need that once i don't
0:36:30
know why we're we're calling it twice we
0:36:35
yes because that was a different
0:36:37
experiment video the hair
0:36:40
so i can get rid of that
0:36:46
good call so thanks for
0:36:48
reminding me that we need to get rid of
0:36:52
extra code reload bold you're right cool
0:36:59
now what we need to basically do is
0:37:05
this is what basically
0:37:07
triggers from the go button
0:37:10
and our passcode is here
0:37:13
we get all our board names here
0:37:16
um it's full name return
0:37:47
you put in two variables on one line how
0:37:51
yeah why not just saving a
0:37:56
i don't think that's less
0:37:59
personally i feel like less readable
0:38:03
that's just my opinion we can argue
0:38:11
all right here we go i'll make you happy
0:38:14
thank you does make it does make me
0:38:20
i think it's just the comma yeah
0:38:24
okay is that it's password valid i
0:38:27
should say it's password rather
0:38:30
i don't think i don't think you'll need
0:38:36
because i am just creating it and i'm
0:38:39
not updating or deleting yeah that's
0:38:42
right that's right
0:38:44
i think we only need it inside of that
0:38:48
like create a board function
0:39:06
create another method
0:39:10
this one which would
0:39:14
result here if this
0:39:18
return true or false
0:39:22
i'm just saying yeah
0:39:27
we're gonna convar we're gonna convert
0:39:29
this project to typescript in 2030 by
0:39:45
uh so return true false so where this is
0:39:52
so we would basically need a passcode
0:39:55
validator in the backend
0:39:58
so first of all let's just do this okay
0:40:27
let's go to the backhand now
0:40:32
i feel like a proper full stack dev
0:40:36
now coding full frontend and the
0:40:46
i thought the backhand was already
0:40:47
opened yes it is open
0:40:56
sorry i'm like five years old that's all
0:41:01
just five years old
0:41:06
okay and then you should if
0:41:09
i think it would be more common to do a
0:41:22
so you would send the password in the
0:41:30
and then compare it
0:41:33
oh yeah yeah true true
0:41:36
that's absolutely right
0:41:41
so where would it be coming from
0:41:45
it would come on board
0:41:51
and then pause code
0:42:00
i think you need the flash in front of
0:42:29
do aussies call it a passcode
0:42:33
password parts code
0:42:42
i think in the us we almost i don't
0:42:45
we never say passcode we just say
0:42:50
uh pin would be probably the right word
0:42:56
actually i just did this pin
0:42:59
convar says i think we usually call it a
0:43:06
i don't know if there's some
0:43:07
some more aussie slang
0:43:12
i love viruses i love artists blank
0:43:16
that's pretty cool to be honest
0:43:19
uh right table name would be
0:43:34
yes lent is on my case now
0:43:38
oh yeah yeah it'll go away
0:43:46
which would be that one and then what i
0:43:52
how is the post request again
0:43:58
new aussie slang no
0:44:00
no walking worries
0:44:03
no no walking furries
0:44:15
just looking for the post thing
0:44:26
that's my one don't need that one at the
0:44:32
post there we go oh we are passing calls
0:44:38
sure you do need the chorus options
0:44:41
all right let's do that one as well
0:44:45
wait do you need chorus for posts
0:44:49
it was this so i'm thinking yes
0:44:53
i forget which methods you need
0:44:56
the brief flight headers
0:44:58
or whatever that follows
0:45:05
fails it will come back
0:45:08
and we can fix it then
0:45:12
so we don't need that one we need the
0:45:14
passcode to come from body
0:45:22
we need the pass code
0:45:29
actually wave was again
0:45:34
oh right i see that is not right
0:45:38
i'm not doing it the right way
0:45:42
i'm going directly in this in that when
0:45:50
i'll start calling it
0:46:07
let's go to password actually everywhere
0:46:10
would it pass because so just
0:46:13
remaining consistent
0:46:20
it's littered all over the front and two
0:46:22
because that's what i use
0:46:26
cool surpass code is coming from the
0:46:33
we can basically check if it's a valid
0:46:41
probably not gonna do at this stage
0:46:44
and it's hashing the past code here so
0:46:48
we should probably hashes
0:46:52
we wouldn't hash it we would compare
0:46:56
to the hashed version
0:47:00
uh yeah there's a method there's like a
0:47:04
method or something
0:47:10
the screen should really be big bigger
0:47:13
than this honestly
0:47:33
so we have passed this pause code
0:47:43
we should go in the table
0:47:45
now to get that don't forget your
0:47:51
you didn't declare
0:48:00
oh it's a global yeah
0:48:03
it was a global variable
0:48:10
need to do is i need to go into
0:48:20
item okay this is just putting it so
0:48:23
what i need is to do a get
0:48:28
yeah just using that get the board
0:48:32
and then if it if it gets the board from
0:48:39
you just check the get the attribute of
0:48:42
the passcode we would need to pass in
0:48:45
the board as well then in this method
0:48:49
you need the um yeah you need the board
0:48:57
the board name board name yeah because
0:48:59
they're typing in the board name
0:49:04
so basically in that case we don't
0:49:07
really need the board name method now
0:49:11
we're doing the check here anyway
0:49:14
right i don't think you need that get
0:49:17
board names anymore yeah
0:49:21
which is good it's an expensive it's an
0:49:23
expensive operation anyways mm-hmm
0:49:38
okay where does this bold name come from
0:49:42
you can also the body
0:49:50
just like when you create the board
0:49:52
you're sending the board name and the
0:49:54
pin here you're just pretty much doing
0:50:02
the only the only difference is now
0:50:06
just getting the board from dynamodb
0:50:12
checking if the password is
0:50:15
the right password
0:50:17
and then that's great because we can
0:50:20
this um this route this path
0:50:25
do to reuse on the other
0:50:36
condition board name so we need this one
0:50:42
wow yeah we need this one
0:50:46
nothing i was just thinking about
0:50:48
something never mind
0:50:50
it's in the future
0:50:55
i like i said he's in the future
0:50:57
look at that don't worry
0:51:03
pastor lee no okay cool so we need to
0:51:07
get this one board named gsi
0:51:13
index name that one
0:51:17
and with that we can hopefully get the
0:51:26
i think you can just do get
0:51:29
like there's a get method
0:51:34
id but it's by id right so you'd have to
0:51:38
so you could use the gsi get the gsi
0:51:43
but or you can use the query
0:51:46
that's what i'm doing here so
0:51:48
if i use the query it will get
0:51:53
so board passcode board name
0:51:57
and all the notes and that's an extra
0:52:04
if you use the gsi
0:52:11
i mean i think the query is better in
0:52:13
this case because otherwise you have to
0:52:14
do two calls to the database one to get
0:52:17
the board name or i mean the board id
0:52:21
yeah from the gsi and then you'd have to
0:52:25
look and get the passcode so probably to
0:52:30
do the query and only return the
0:52:34
only return the passcode
0:52:37
and then well i guess you need the name
0:52:39
too you need the passcode and the name
0:52:41
and just make sure they're both the same
0:52:43
although they should be
0:52:48
so yeah let's do that
0:52:55
so what is this doing
0:52:57
i think that one's using query right
0:53:01
yeah so we can use
0:53:06
that'll work great and all you got to do
0:53:07
is just add the pass code to the
0:53:14
attributes or expression attribute
0:53:22
wait what's the one where it returns
0:53:27
only certain values
0:53:31
is that projection
0:53:34
i don't know i'm gonna look it up
0:53:36
i think it's projection
0:53:40
or we could just do this and then just
0:53:44
yeah i think it's something like that
0:53:47
rejection express index name key
0:53:50
condition expression and then projection
0:53:52
expression would be
0:54:00
but we want that board itself only
0:54:04
isn't it it's a board
0:54:22
and then what we do need is
0:54:25
the passcode here as well
0:54:30
so what this key condition expression is
0:54:33
so this is giving us the board name
0:54:37
but we want the passcode as well so well
0:54:41
no that's gonna that's gonna look up
0:54:44
the key condition expression is
0:54:48
it's gonna use the query to look up the
0:54:52
and match the name
0:54:56
so it's going to go through okay yeah
0:55:00
so basically we don't really need to um
0:55:09
need to do this at all because here we
0:55:12
are already getting the board
0:55:17
no that's for matching the board
0:55:21
that's for the that's for the query to
0:55:23
match it's going to look at the table
0:55:27
i'm going to look at the attribute board
0:55:30
and then i'm going to check if
0:55:33
the one that was passed to me oh sir are
0:55:35
you saying you're going to pass the the
0:55:43
kind of concept was
0:55:46
here we are telling it
0:55:48
okay we want this board name
0:55:53
and then it will get the entire board
0:56:01
as in board id board names
0:56:04
or attributes passcode and then over
0:56:07
here we can basically just compare
0:56:12
as in if the board
0:56:15
if the pass code matches that as well
0:56:20
no if the if the passcode matches the
0:56:23
board named passcode then we wanna we
0:56:26
want to get the entire board
0:56:31
why do we want the entire board though
0:56:36
you know when we press
0:56:42
when say you have created a board
0:56:47
and after a few days you want that exact
0:56:57
that you previously
0:57:03
which it will come here
0:57:06
and then also match the past passcode
0:57:13
returns the matching board board object
0:57:17
then it would say okay the board name
0:57:19
matches the passcode matches
0:57:22
show the user the entire board
0:57:25
but it's gonna redirect them on the
0:57:34
okay but then they're gonna lose they're
0:57:36
gonna unless you save it in like local
0:57:38
storage or something they're gonna lose
0:57:42
okay i guess that i was kind of
0:57:52
show them the board i meant i meant that
0:57:55
if this criteria passes
0:58:05
then it won't show that message but when
0:58:10
next page it would
0:58:12
show them the board itself
0:58:14
which is another additional step
0:58:18
uh but when you go to the board with the
0:58:21
url which it's going to redirect them to
0:58:27
it's going to automatically load the
0:58:29
board notes like it already does that
0:58:35
but the users won't
0:58:39
them they might not
0:58:41
load as in directly the url
0:58:48
yeah it gets you get redirected anyways
0:58:51
like there's javascript code on the
0:58:54
front end that when you create a board
0:58:56
it'll redirect them and i'm assuming
0:59:00
the same thing will happen here if you
0:59:01
enter the right passcode and board name
0:59:03
then you're gonna get redirected too
0:59:08
and then what's gonna happen
0:59:13
the page already loads like the boards
0:59:15
and populates all the notes without the
0:59:19
you don't need to do anything extra
0:59:23
so that is the step that i'm talking
0:59:28
in the kind of step for free but this is
0:59:33
after that we will go in the front end
0:59:40
we didn't receive any
0:59:42
errors you can keep on continuing what
0:59:46
whatever you want it to do
0:59:50
and then the code once
0:59:52
is satisfied with the written result
0:59:58
resume with the normal
1:00:02
logic of the app yeah so this is just
1:00:05
turning returning this this post
1:00:11
yeah it's just true it's just falsy
1:00:14
okay yeah that makes sense yes
1:00:18
yeah we're on we're we're totally on the
1:00:20
same page yeah yeah absolutely
1:00:26
try this one and if it doesn't match
1:00:42
i just invented a try category block
1:00:59
yeah there you go this was the one
1:01:07
we need to do this no no we don't need
1:01:10
to do this at the moment
1:01:14
board items length
1:01:17
i think we might need to do this as well
1:01:26
i thought we were just checking to see
1:01:29
the board if we can get the board from
1:01:33
right that's step one
1:01:36
if dynamodb returns us a board
1:01:41
look at the data from dynamodb
1:01:45
and then we use decrypt
1:01:48
to compare the password from that's sent
1:01:51
in the body of the request to the past
1:01:56
and then if that's good then we just
1:01:59
true otherwise we return false that's
1:02:03
yeah yeah absolutely
1:02:08
so this is the error json stringify
1:02:17
we might not need this
1:02:20
you might not need
1:02:22
this part wait save board is there
1:02:28
okay then that is there
1:02:31
otherwise um so if
1:02:42
you could you could do the whole thing
1:02:43
in the tribe in the try block honestly
1:02:52
so we have the board board now all we
1:03:03
board does whatever
1:03:06
if i don't know what dynamo db yeah
1:03:12
i i think he was bored
1:03:18
you can look at the other ones
1:03:22
the other examples i don't remember
1:03:25
it's weird it's like items that yeah i
1:03:28
think it's items that something
1:03:34
first in this arsenal certainly
1:03:42
oh here we go i had some stuff fine
1:03:48
nuts equal to that one
1:03:54
so that would basically
1:04:01
let's do this part here
1:04:04
find boolean and then
1:04:07
the actual thing board
1:04:11
oh we will need to implement the for
1:04:17
no no no no no no no no
1:04:22
i think it's going to give you
1:04:25
uh well according to what i saw from the
1:04:28
code it will give you
1:04:30
the items which is an array
1:04:32
and then there should only be one item
1:04:35
because there should only be one board
1:04:37
name and then it's we'll just have the
1:04:40
attribute names that the way they exist
1:04:59
items is uh items is an array though
1:05:06
so you you just need to access the
1:05:09
you just need to check if there's
1:05:14
yeah or that that's fine
1:05:21
check if the length is not zero of the
1:05:23
items and then you just yeah that's
1:05:25
whatever that's probably better
1:05:30
so i changed that one why is it coming
1:05:33
with this tab uh it's items plural
1:05:47
if that one is equal to
1:05:51
no i don't want that one to happen there
1:05:55
board name equals actually we shouldn't
1:05:58
really have to check the board name
1:06:00
because we already brought us that one
1:06:04
i think you just want to check if items
1:06:07
if board dot items
1:06:10
dot length like the length of the array
1:06:18
and if it is zero then you know you're
1:06:21
gonna send back like a
1:06:23
not found message or something
1:06:28
board doesn't exist
1:06:31
or password is incorrect
1:06:36
oh it's getting late wow
1:06:39
you've been jamming
1:06:42
oh wow 1043 already
1:06:47
so a board or item door length is equal
1:06:51
to that one then return
1:07:13
not that one then we're reading for the
1:07:21
yeah you can do that or i think it
1:07:23
should only be in the first the zeroth
1:07:28
because there should only be one item in
1:07:48
all right that's no because the passcode
1:07:52
so this is where you're gonna
1:08:06
i think it was compared
1:08:26
is here and then our hashed version will
1:08:31
let's call it here
1:08:41
uh i don't mean to look at the i'll look
1:08:44
at the dock but whoops
1:08:46
is there a third parameter
1:08:50
i've got feeling there is one but we
1:08:52
might not need that
1:08:55
uh and you can i think
1:08:57
can you await that is that possible is
1:08:59
that a asynchronous operation
1:09:31
you're gonna you're gonna take all that
1:09:33
from me yes then yes lynn don't tell me
1:09:45
yeah that's it you just pat in a string
1:09:48
in the ash that's it
1:09:51
and then you can use it as
1:09:54
you can use async method so
1:09:57
you can just put a weight in front of it
1:10:02
i guess you would just check if it's
1:10:04
true or something i don't know what it
1:10:06
returns i'm trying to look at that
1:10:09
yeah i just it just gets a boolean
1:10:12
it just returns a boolean
1:10:18
yeah perfect so that can basically
1:10:21
determine what do we get
1:10:27
so you'll just send that back in the
1:10:30
or in the response
1:10:53
another variable here so then
1:11:07
result equals that
1:11:19
status and there we go perfect
1:11:31
so in the case of false
1:11:34
the result will be undefined
1:11:42
because you're not setting the result
1:11:51
i thought i felt that
1:11:55
that one that okay
1:12:00
nice job looks good what's that
1:12:04
what do you need from me
1:12:08
closing curly braces
1:12:11
i want you to move the catch up
1:12:13
to the same line wow are you serious
1:12:19
that is that is usually how it is but
1:12:29
block must not be petted by yes
1:12:34
here we go my darling there we go
1:12:38
are you happy now yes you seem happy
1:12:42
there we go i mean you do you i use
1:12:45
typescript at work now
1:12:46
no not at this minute oh it yells at you
1:12:50
all the time like yes
1:12:52
because it has its own linting so it's
1:12:54
just yelling at you all the time the
1:12:57
space is required really
1:13:06
let's test this tomorrow now because
1:13:08
it's a bit too late now
1:13:10
yup sounds good looks good though
1:13:15
i think we just need to add it on the
1:13:20
okay so i'll just add this
1:13:23
oh no i don't want to add all of them
1:14:19
how's that coke hitting here
1:14:24
i think i'm pretty
1:14:26
good job though but for some reason i
1:14:28
don't really like the taste of it it's
1:14:32
it is it is it's like
1:14:34
really sweet i only have a coke
1:14:37
maybe once every couple months
1:14:45
that's basically as in
1:14:47
and i need to order
1:14:49
more of those um energy drinks that i
1:14:55
i'll be probably ordering double the
1:14:59
wow what a good question yeah
1:15:04
i love those ones man yeah anyway do you
1:15:07
want to be the owners
1:15:12
um fixed the miner get issue and then
1:15:18
uh some password validation on the back
1:15:23
with decrypt and we're going to
1:15:25
implement that later on the front end
1:15:28
where the user will send the password to
1:15:33
serverless express app and that
1:15:37
get the board from dynamodb and then use
1:15:40
the grip compare method to
1:15:43
validate the password for that board
1:15:48
that was nicely and simply put
1:15:53
all right guys if you want to check us
1:15:55
how we implement the front end of this
1:15:58
um validation and then get the
1:16:02
board which which would be a added one
1:16:07
basically be the last functionality of
1:16:15
nice yeah really looking forward to that
1:16:20
tomorrow's same place
1:16:29
that's the one all right guys have a
1:16:32
great night thank you have a great night
1:16:34
thanks convoy cheers