Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
HUNG-rushb committed Jan 8, 2024
1 parent 5b60223 commit 9685e0c
Show file tree
Hide file tree
Showing 4 changed files with 335 additions and 45 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DATABASE_URL="mongodb+srv://Hung:[email protected]/Social_Image"
USER_SIMILAR_WEIGHT={"following":"0.5","interest":"0.3","skill":"0.2"}

AWS_ACCESS_KEY="AKIA5QPIZ6HZL3N52DDZ"
AWS_SECRET_ACCESS="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"
AWS_BUCKET_NAME="bku-images"
36 changes: 36 additions & 0 deletions src/resolvers/Mutation/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ const postMutation = {
postViewStatus: args.data.postViewStatus,
contestId: args.data.contestId,
points: 0,
// points: Math.floor(Math.random() * 30) + 1,

categoryId: args.data.categoryId ? args.data.categoryId : [],
albumId: args.data.albumId ? args.data.albumId : [],
tag: args.data.tag ? args.data.tag : [],
reportedUserIds: [],
// createdAt: new Date(1701979626 * 1000),
// createdAt: new Date(1699387626 * 1000),

image: {
create: {
Expand All @@ -49,6 +52,39 @@ const postMutation = {
},
},
});

// let newTag = [
// ...new Set(
// args.data.tag.map((element) => {
// return element.toLowerCase();
// }),
// ),
// ];

// await Promise.all(
// newTag.map(async (tagName) => {
// const a = await prisma.tag.count({
// where: {
// name: tagName,
// },
// });

// if (!a) {
// try {
// await prisma.tag.create({
// data: {
// name: tagName,
// },
// });

// // console.log({ tag });
// } catch (e) {
// console.log(e);
// throw e;
// }
// }
// }),
// );
// console.log({ post });

await prisma.notification.create({
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/Mutation/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const userMutation = {
isAdmin: 0,
age: 18,
notiIds: [],
contestPrizeList: [],
// contestPrizeList: [],
level: {
create: {
currentXP: 0,
Expand Down
Loading

0 comments on commit 9685e0c

Please sign in to comment.