-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from curieo-org/eng-190
New Search and Profile Frontend
- Loading branch information
Showing
94 changed files
with
2,394 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Image = curieo-agency | ||
ECR = 698471419283.dkr.ecr.eu-central-1.amazonaws.com/curieo-agency | ||
TAG = 2.0 | ||
TAG = 3.0 | ||
|
||
ecr_deploy: login | ||
docker buildx build --platform linux/amd64 -t $(Image) . | ||
docker tag $(Image) $(ECR):$(TAG) | ||
docker push $(ECR):$(TAG) | ||
|
||
login: | ||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 698471419283.dkr.ecr.eu-central-1.amazonaws.com | ||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 698471419283.dkr.ecr.eu-central-1.amazonaws.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use server' | ||
|
||
import { UpdatePasswordBody, UpdateProfileBody, UserProfile } from '@/types/settings' | ||
import { encodeAsUrlSearchParams } from '@/utils' | ||
import { curieoFetch } from './fetch' | ||
|
||
export async function fetchUserProfile(): Promise<UserProfile> { | ||
const response = await curieoFetch('/users/me') | ||
if (response.ok) { | ||
return (await response.json()) as UserProfile | ||
} | ||
throw new Error('Could not retrieve user profile') | ||
} | ||
|
||
export async function updateUserProfile(payload: UpdateProfileBody): Promise<UserProfile> { | ||
const response = await curieoFetch('/users/me', { | ||
method: 'PATCH', | ||
body: JSON.stringify(payload), | ||
}) | ||
if (response.ok) { | ||
return (await response.json()) as UserProfile | ||
} | ||
throw new Error('Could not update user profile') | ||
} | ||
|
||
export async function updatePassword(payload: UpdatePasswordBody): Promise<void> { | ||
const response = await curieoFetch('/users/update-password', { | ||
method: 'PATCH', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}, | ||
body: encodeAsUrlSearchParams(payload), | ||
}) | ||
if (response.ok) { | ||
return | ||
} | ||
throw new Error('Could not update password') | ||
} |
Oops, something went wrong.