-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrei Hava <[email protected]>
- Loading branch information
1 parent
aad6f56
commit fe29218
Showing
46 changed files
with
112 additions
and
159 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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
utils/email/templates/head.mjml → services/email/templates/head.mjml
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...mail/templates/tupu-app-notification.mjml → ...mail/templates/tupu-app-notification.mjml
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,15 +1,15 @@ | ||
<mjml> | ||
<mj-include path="./head.mjml" /> | ||
<mj-include path="head.mjml" /> | ||
<mj-body> | ||
<mj-include path="./header.mjml" /> | ||
<mj-include path="header.mjml" /> | ||
<mj-section> | ||
<mj-column width="100%"> | ||
<mj-text> | ||
[[NOTIFICATION_BODY]] | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-include path="./footer-madalina-tupu-team.mjml" /> | ||
<mj-include path="./footer.mjml" /> | ||
<mj-include path="footer-madalina-tupu-team.mjml" /> | ||
<mj-include path="footer.mjml" /> | ||
</mj-body> | ||
</mjml> |
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,9 @@ | ||
import {getXataClient} from "./xata"; | ||
|
||
const xata = getXataClient(); | ||
|
||
export async function createMentor({ id }) { | ||
return await xata.db.mentors.create({ | ||
user: id, | ||
}); | ||
} |
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,34 @@ | ||
import {getXataClient} from "./xata"; | ||
|
||
const xata = getXataClient(); | ||
|
||
export async function createProfile({id, name}) { | ||
return await xata.db.profiles.create({ | ||
user: id, | ||
name: name, | ||
}); | ||
} | ||
|
||
export async function getProfileByUserId(id) { | ||
return await xata.db.profiles | ||
.select(["*", "user.*"]) | ||
.filter({'user.id': id}) | ||
.getFirst(); | ||
} | ||
|
||
export async function getProfileByEmail(email) { | ||
return await xata.db.profiles | ||
.select(["*", "user.*"]) | ||
.filter({'user.email': email}) | ||
.getFirst(); | ||
} | ||
|
||
export async function getProfileByExternalId({ provider, externalId }) { | ||
return await xata.db.profiles | ||
.select(["*", "user.*"]) | ||
.filter({ | ||
'user.provider': provider, | ||
'user.externalId': externalId | ||
}) | ||
.getFirst(); | ||
} |
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,26 +1,15 @@ | ||
import { getXataClient } from "./xata"; | ||
import {getXataClient} from "./xata"; | ||
|
||
export async function getUser(session) { | ||
const xata = getXataClient(); | ||
return xata.db.users.filter("email", session.user.email).getFirst(); | ||
} | ||
|
||
export async function getUserByEmail(email) { | ||
const xata = getXataClient(); | ||
return xata.db.users.filter("email", email).getFirst(); | ||
} | ||
const xata = getXataClient(); | ||
|
||
export async function getUserById(id) { | ||
const xata = getXataClient(); | ||
const user = await xata.db.users.read(id); | ||
console.log("getUserById: found user with id", user.id, user); | ||
return user; | ||
export async function createUser({ email }) { | ||
return await xata.db.users.create({ | ||
email: email, | ||
// TODO: Don't add mentor role by default | ||
roles: ["mentor", "mentee"], | ||
}); | ||
} | ||
|
||
export async function getRequestById(id) { | ||
const xata = getXataClient(); | ||
return await xata.db.requests | ||
.select(["*", "mentee.email", "mentee.name", "mentor.email", "mentor.name"]) | ||
.filter("id", id) | ||
.getFirst(); | ||
} | ||
export async function getUserByEmail(email) { | ||
return await xata.db.users.filter("email", email).getFirst(); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.