Skip to content

London | 26-ITP-Jan | Asha Ahmed | Sprint 2 | Book Library#421

Open
ashaahmed7 wants to merge 2 commits intoCodeYourFuture:mainfrom
ashaahmed7:book-library
Open

London | 26-ITP-Jan | Asha Ahmed | Sprint 2 | Book Library#421
ashaahmed7 wants to merge 2 commits intoCodeYourFuture:mainfrom
ashaahmed7:book-library

Conversation

@ashaahmed7
Copy link
Copy Markdown

@ashaahmed7 ashaahmed7 commented Apr 11, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I fixed the bugs in the code and corrected the syntax

Questions

N/A

@ashaahmed7 ashaahmed7 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 11, 2026
@Luro91 Luro91 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 12, 2026
Copy link
Copy Markdown

@Luro91 Luro91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should I run the project?

When I open the html file in the browser I get this error:
index.html:1 Access to script at Module-Data-Flows/debugging/book-library/script.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app. script.js:1 Failed to load resource: net::ERR_FAILED index.html:1 Unsafe attempt to load URL file://Module-Data-Flows/debugging/book-library/index.html from frame with URL file:///Module-Data-Flows/debugging/book-library/index.html. 'file:' URLs are treated as unique security origins.

.form-group {
width: 400px;
height: 300px;
align-self: left;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

THe commit messages "Refactor input validation and improve book submission logic in script.js" does not make this clear to me

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looked a bit off to me to I decided to change it.

I will be more careful when I commit a file and make sure it doesn't get conflicted with my commit message in the near future, sorry for the confusion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It's good practice to split up commits into logical parts and not add all changes in one commit:

A commit should describe what changed in the code. It's also good practice to split commits into logical blocks (for example for each task or each review comment). This makes it easier to understand and additionally the commits could also be undone more easily if needed.
I like this article about commit messages: https://chris.beams.io/git-commit

pagesCount <= 0
) {
alert("Please fill all fields!");
alert(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce error handling

@Luro91 Luro91 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 12, 2026
@ashaahmed7
Copy link
Copy Markdown
Author

How should I run the project?

When I open the html file in the browser I get this error: index.html:1 Access to script at Module-Data-Flows/debugging/book-library/script.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app. script.js:1 Failed to load resource: net::ERR_FAILED index.html:1 Unsafe attempt to load URL file://Module-Data-Flows/debugging/book-library/index.html from frame with URL file:///Module-Data-Flows/debugging/book-library/index.html. 'file:' URLs are treated as unique security origins.

I've just tested this. I right clicked on html file and selected live server and it took me straight to my book library.

@ashaahmed7 ashaahmed7 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 16, 2026
</table>

<script src="script.js"></script>
<script src="script.js" type="module"></script>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this to module? (It is the reason why the app only works in the live server and not if you just open the html file in the browser directly)

@Luro91 Luro91 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 17, 2026
@Luro91
Copy link
Copy Markdown

Luro91 commented Apr 17, 2026

Well done. The code works as expected. The only comment I have is on the change to module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants