Prohibit identical class names within site PART 2#795
Prohibit identical class names within site PART 2#795rolivares93 wants to merge 8 commits intomainfrom
Conversation
|
Visit the preview URL for this PR (updated for commit c9dabf0): https://hs-levante-admin-dev--pr795-bug-737-prohibit-ide-r5575q2b.web.app (expires Mon, 23 Feb 2026 15:16:47 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 7889bff1da3bcc333d7422b9fc863c65b3962be7 |
|
Testing works as expected - ready to merge pending code review. |
fhconte
left a comment
There was a problem hiding this comment.
Approved overall, with two important comments to consider before merging. Please review those points before merge.
| }, | ||
| }; | ||
|
|
||
| try { |
There was a problem hiding this comment.
Non‑blocking suggestion: consider failing closed on query errors. Returning false on a network/index failure can allow creation and let duplicates slip through; maybe it may be safer to surface the error here.
| return false; | ||
| } | ||
|
|
||
| const requestBody = { |
There was a problem hiding this comment.
When currentSite is 'any', the site‑scoped filter won’t match and duplicates can slip through. If this is the intended behavior, and maybe super admins are not even touching this part, all good.
|
|
||
| try { | ||
| const response = await axios.post(`${documentPath}:runQuery`, requestBody); | ||
| const mappedData = mapFields(response?.data); |
There was a problem hiding this comment.
Instead of using POST can't you use the query and getDocs exposed from firebase/firestore?
An example would be:
const assignmentsQuery = query(
collection(db, "assignments"),
orderBy("createdAt"),
limit(PAGE_SIZE), // for pagination (optional)
startAfter(lastDoc) // optional (for offset)
)
const snapshot = await getDocs(assignmentsQuery)
Potentially this can be moved to firekit as well.
There was a problem hiding this comment.
This will be fixed as soon as we normalize the db, so we'll be able to create/re-create queries as necessary.
|
@digital-pro why did you set this PR as blocked? |
Proposed changes
I refactored the useOrgNameExistsQuery.
Screen.Recording.2026-02-03.at.12.38.56.mov
Types of changes
What types of changes does this pull request introduce?
Additional Notes