Moonlit
Moonlit
CC#
Created by Moonlit on 11/17/2024 in #help
Dynamically creating rows inside of document.createElement() isn't working with a template?
${command.replies.filter(reply => reply.replyType === 'General')
.map(reply => `<li><div contenteditable="true" class="reply-text">${reply.replyText}</div><button class="delete-btn">x</button></li>`)
.join('')}
${command.replies.filter(reply => reply.replyType === 'General')
.map(reply => `<li><div contenteditable="true" class="reply-text">${reply.replyText}</div><button class="delete-btn">x</button></li>`)
.join('')}
So for now I replaced it with this and it works... I'd much rather use the template but if nobody is able to explain how to fix the template thingy, at least it's working
2 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Man EFT really does a lot of the heavy work... Well I think that's it? Unless there is anything you'd like to add? Thanks for the help! I really appreciate it, I was pretty lost before
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Okay yeh EFC seems really good... So what I have gathered is as soon as I use AppUser, it will use the ForeignKey to load it the first time it is accessed and then cache it. The Replies I don't need foreign keys for, because if I try to access the Command.Replies, it will query the DB for all the Replies that have this command as their foreign key. I think I've got it
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Or does it load the AppUser as soon as the UserID is set?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
If I am understanding that correctly then I think I'm good tbh
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
I honestly think the DTO might actually just fix all of this tbh... I'm just looking into it and as far as I am aware... If my UserID is set with the foreing key for AppUser. When I try to access AppUser from Command, it will load it from the DB using that foreign key?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Is there a general naming convention for these things? Should I just call the class CommandDTO?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Hmm this is pretty hard to read
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Okay so Replies being an ICollection is right
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Yeh I was trying to get lazy loading to work because everytime a user adds a new command or edits one, I didn't want to need to fetch all of their data every time
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
AppUser > Command > Replies
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
If that is the case... I feel that my Replies is probably setup wrong because I don't actually state what foreign key it ties too and each reply should have a foreign key
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Okay thanks! I still don't quite understand how the virtual thing automatically handles DB relationships... If I create a Command and pass in the ID, it will automatically link the AppUser if it's done on the server exclusively?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
And then my server will use that DTO to create the more complex one that my "Command" class is currently?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
Ohh I see... So I basically simplify the class and that is what I will send in between the clients and the server instead?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
What is a DTO class?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
I don't get it :HarryCry: I thought that would be automated if I pass in the UserID because it's a ForeignKey of Appuser
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
How do I even do that then... Do I make AppUser nullable and then when the server gets the POST request, retrieve the AppUser and set it to the commands AppUser?
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
I mean I was sending Replies, so the issue must have been the AppUser
41 replies
CC#
Created by Moonlit on 11/16/2024 in #help
✅ Local Post, 400 Bad Request. Can't figure out why?
I honestly don't fully understand the way that they work, I don't know how they get the AppUser or the Replies... I don't quite understand how they stay updated and etc... I know that a lot of it is automated
41 replies