Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): react query migration #513

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

JoshCLim
Copy link
Contributor

@JoshCLim JoshCLim commented Aug 4, 2024

use axios instead of fetch
use React query instead of useFetch hooks

#511

KavikaPalletenne and others added 30 commits October 5, 2023 12:38
* start implementing authorisation

* feat(backend): implement extractor for AuthUser (user id)

* feat(backend): implement extractor for SuperUser (user id + authZ)

---------

Co-authored-by: kappamalone <[email protected]>
* start implementing authorisation

* feat(backend): implement extractor for AuthUser (user id)

* feat(backend): implement extractor for SuperUser (user id + authZ)

* feat(backend): get existing or create new user for Google login

* feat(backend): get name from Google user profile

* feat(backend): update schema.prisma to include lowercase table names + updated_at default time for users

---------

Co-authored-by: kappamalone <[email protected]>
* feat(ci): add postgres and migration to actions workflow

* fix(ci): fix incorrect working directory
* feat(ci): add postgres and migration to actions workflow

* fix(ci): fix incorrect working directory

* fix(ci): ran cargo fmt and fix build errors
* feat(ci): add postgres and migration to actions workflow

* fix(ci): fix incorrect working directory

* fix(ci): ran cargo fmt and fix build errors

* fix(ci): Incorrect working directory for cargo fmt

* fix(ci): rust-cache keys
* feat(ci): add postgres and migration to actions workflow

* fix(ci): fix incorrect working directory

* fix(ci): ran cargo fmt and fix build errors

* fix(ci): Incorrect working directory for cargo fmt

* fix(ci): rust-cache keys

* fix(ci): add workspaces to rust-cache
* feat(ci): add postgres and migration to actions workflow

* fix(ci): fix incorrect working directory

* fix(ci): ran cargo fmt and fix build errors

* fix(ci): Incorrect working directory for cargo fmt

* fix(ci): rust-cache keys

* fix(ci): add workspaces to rust-cache

* fix(ci): cargo fmt remove manifest-path arg
* fix(ci): run CI on rewrite branch pull request

* feat(docs): added endpoint docs for org and users
* feat(docs): updates to user and organisation api spec

* feat(docs): draft spec for campaign api

* fix(ci): update rust workflow to use actions/cache
* feat(backend): create sql migrations

* feat(backend): remove prisma schema

* fix(ci): change from prisma migration to sql

* fix(ci): no default sqlx-cli features

* fix(backend): remove duplicate primary key for applications

* fix(backend): rename migrations to prepend 'create'

* fix(ci): check for cached sqlx before installing with cargo

* fix(ci): remove ci run on specific paths
* feat(db): add indexes for foreign key reference columns

* fix(db): index naming and missing semicolons

* dep(backend): update axum

* fix(backend): remove testing jwt handlers

* feat(backend): Add custom jwt validator and header

* feat(backend): basic error handling enum

* fix(backend): ran cargo fmt

* fix(backend): remove unused imports
* feat(db): add indexes for foreign key reference columns

* fix(db): index naming and missing semicolons

* dep(backend): update axum

* fix(backend): remove testing jwt handlers

* feat(backend): Add custom jwt validator and header

* feat(backend): basic error handling enum

* fix(backend): ran cargo fmt

* fix(backend): remove unused imports

* Change to using `thiserror`

* remove 'Error' from logic error names
* feat: Initial draft
TODO: TESTING + more clarification

* rearranged import

* clear errors

* post testing

* feat(db): add indexes for foreign key reference columns

* fix(db): index naming and missing semicolons

* dep(backend): update axum

* fix(backend): remove testing jwt handlers

* feat(backend): Add custom jwt validator and header

* feat(backend): basic error handling enum

* fix(backend): ran cargo fmt

* fix(backend): remove unused imports

* CRUD operations - awaiting Campaign - haven't enforced db safety

* implement feedback

* Update rust.yml to include 224 branch

* logic and style fixes

* Change to using `thiserror`

* add organisation_role type to db

* update migration timestamps to be `NOT NULL`

* change sqlx `time` to `chrono`

* integrate organisations crud with error handling

* return member role with org members

* update sqlx type name for `UserRole`

* simplify handlers to use new error type

* removed unused imports

* added `OrganisationAdmin` extractor

* use `Transaction` when doing multiple queries

* cargo fmt

* add org route to app

* move `Organisation` service functions into `Organisation` struct

* moved org handlers into `OrganisationHandler` struct

* ran cargo fmt

* add S3 url generation to logo update

* fixed error renaming

* add routes to `main.rs`

* cargo fmt

---------

Co-authored-by: Alexander <[email protected]>
Co-authored-by: Kavika <[email protected]>
* boilerplate for campaign

* service layer for get, patch,put delete

* handler updates

* handler layer finalised

* updated campaigns

* fixed patch issue

* remove empty `service/campaign.rs` file

* add `organisation_name` to campaign details response

* fix indentation of query code

* change `cover_image` column type to UUID

* minor changes

* ran `cargo fmt`

* remove unused `state` param

* insert `organisation_id` when creating new campaign

* change `organisations` logo column to `UUID`

---------

Co-authored-by: Kavika <[email protected]>
* feat: added Role struct in model, implmented get and post for Role, updated api ymal for Role, added migration to change Role table in db

* feat:added methods for delte and update role;added handler for role and added some routes into main regarding role

* feat: added more api yaml documentation, added handler for create and get all roles in a campaign, added get all in roles in a campagin in model

* fix: changed get_roles to Campaign Handler, changede migration file

* change all id columns to `BIGINT` or `BIGSERIAL`

* create `RoleAdmin` struct

* move `create_role()` to `CampaignHandler`

* cleanup

* ran cargo fmt

---------

Co-authored-by: Alex_Miao_WSL <[email protected]>
Co-authored-by: Kavika <[email protected]>
AlexMIaoPU and others added 4 commits August 2, 2024 15:14
* feat: added model file for application; added create method. fix: changed schema for application_role, fixed id type for role.

* attempt to implement get for application; added additional fields for role response struct

* added additional field to Application response type

* feat: added get methods for application in model

* fix pool usage in model/role, added set_status methods to application, patched API routes for get_all routes

* added handlers for application; implemented Auth for ApplicationAdmin

* added routes for applications in main; implement more handlers; moved some application handler methods to other more appropriate handlers

* change `*Admin` `FromRequest` implementations to use HashMap of path variables

* make 'Pending' the default Application status

* return user info with `ApplicationDetails`

---------

Co-authored-by: Alex_Miao_WSL <[email protected]>
Co-authored-by: Kavika <[email protected]>
* added get_username for all users logged in

* updted user crud

* efficient user get fucntion

* finished user but no testing

* finished user crud

* docker working file

* set users `created_at` and `updated_at` to not null

* set optional fields to `Option` in `User` struct

* fix `query_as` with custom enums

* finished user crud

* changed User CRUD to use handler struct

* move `User` DB logic to `models::User` file

* add pronouns and gender to `User`

* remove TODO comment

* fixed errors and warnings with adding new user fields

---------

Co-authored-by: Alex_Miao_WSL <[email protected]>
Co-authored-by: Kavika <[email protected]>
@JoshCLim JoshCLim added the A: Frontend Frontend related issues label Aug 4, 2024
@JoshCLim JoshCLim marked this pull request as draft August 4, 2024 00:15
@KavikaPalletenne KavikaPalletenne added the 2024 Work from 2024 label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 Work from 2024 A: Frontend Frontend related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants