-
Notifications
You must be signed in to change notification settings - Fork 1
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 #123 from cocola-dev/developer
* Update New.tsx * make comment section working * Fix formatting issues in code * Update Production_chacks.yml * Bump vite from 5.1.2 to 5.2.8 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.2 to 5.2.8. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.2.8/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Create dependabot.yml * Update package.json with new dependencies and fix formatting issues in code * Update package-lock.json * Bump vite in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the / directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). Updates `vite` from 5.1.2 to 5.2.8 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.2.8/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <[email protected]> * bug: fix broken link in email confirm (#122) * bug: fix broken link in email confirm * fix: change resources variable --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
Showing
33 changed files
with
2,592 additions
and
1,909 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} | ||
} |
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,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ on: | |
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: ["*"] | ||
|
||
jobs: | ||
build: | ||
|
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"use server"; | ||
|
||
import { db } from "@/lib/db"; | ||
import { Comment } from "@prisma/client"; | ||
|
||
type FetchCommentsResult = { | ||
success: boolean; | ||
message?: string; | ||
data?: Comment[]; | ||
}; | ||
|
||
export const fetchComments = async ({ | ||
repositoryPath, | ||
issuePullRequestDiscussionId, | ||
}: { | ||
repositoryPath: string | null; | ||
issuePullRequestDiscussionId: string | undefined; | ||
}): Promise<FetchCommentsResult> => { | ||
if (!repositoryPath || !issuePullRequestDiscussionId) { | ||
return { | ||
success: false, | ||
message: "repositoryPath and issuePullRequestDiscussionId is req!", | ||
}; | ||
} | ||
|
||
const data = await db.comment.findMany({ | ||
where: { | ||
repositoryPath: repositoryPath, | ||
issuePullRequestDiscussionId: issuePullRequestDiscussionId, | ||
}, | ||
}); | ||
|
||
return { success: true, data: data }; | ||
}; |
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,69 @@ | ||
"use server"; | ||
|
||
import { db } from "@/lib/db"; | ||
import { Comment } from "@prisma/client"; | ||
|
||
export const createComment = async ({ | ||
repositoryPath, | ||
body, | ||
user, | ||
IssuePullRequestId, | ||
}: { | ||
repositoryPath: string | null; | ||
body: string | null; | ||
user: string | undefined; | ||
IssuePullRequestId: string | undefined; | ||
}) => { | ||
if (!repositoryPath || !user || !IssuePullRequestId) { | ||
return { data: null, success: false }; | ||
} | ||
|
||
if (!body) { | ||
return { data: null, success: false, Message: "Body is required" }; | ||
} | ||
|
||
// find last comment number | ||
|
||
const latestComment = await db.comment.findFirst({ | ||
where: { | ||
repositoryPath: repositoryPath, | ||
}, | ||
orderBy: { | ||
number: "desc", | ||
}, | ||
}); | ||
|
||
// ! DEBUG: [X] console.log("latestComment", latestComment); | ||
|
||
// crete new comment with body author number issuePullRequestDiscussionId | ||
|
||
const nextIssueNumber: number = latestComment ? latestComment.number + 1 : 1; | ||
|
||
// ! DEBUG: [X] console.log("nextIssueNumber", nextIssueNumber) | ||
|
||
const comment: Comment = await db.comment.create({ | ||
data: { | ||
body: body, | ||
author: user, | ||
repositoryPath: repositoryPath, | ||
number: nextIssueNumber, | ||
issuePullRequestDiscussionId: IssuePullRequestId, | ||
}, | ||
}); | ||
|
||
// find issuePullRed and update commentscount to + 1 | ||
|
||
await db.issuePullRequest.update({ | ||
where: { | ||
id: IssuePullRequestId, | ||
repositoryPath: repositoryPath, | ||
}, | ||
data: { | ||
commentscount: { | ||
increment: 1, | ||
}, | ||
}, | ||
}); | ||
|
||
return { data: comment, success: true }; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.
1ee028e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cocola – ./
cocola.vercel.app
www.cocola.tech
cocola-ruru-07.vercel.app
cocola.tech
cocola-git-production-ruru-07.vercel.app