Skip to content

Commit

Permalink
public comments update
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Dec 3, 2023
1 parent c714ed1 commit 24f2a8a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/controllers/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export function ticketRoutes(fastify: FastifyInstance) {
await prisma.comment.create({
data: {
text: text,
public: Boolean(false),
public: public_comment,
ticketId: id,
userId: user!.id,
},
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/lib/nodemailer/ticket/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export async function sendComment(
try {
let mail;

console.log("Sending email to: ", email);

const emails = await prisma.email.findMany();

if (emails.length > 0) {
Expand Down
37 changes: 26 additions & 11 deletions apps/client/pages/tickets/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -723,16 +723,22 @@ export default function Ticket() {
{item.user.name}
</span>
</div>
<p className="text-xs text-gray-500">
{/* {item.public
? "Publicly"
: "Internally"}
{t("commented_at")} */}
Commented at{" "}
{moment(item.createdAt).format(
"DD/MM/YYYY hh:mm"
)}
</p>
<div className=" flex flex-row space-x-1">
<span className="text-xs text-gray-500">
{item.public
? "Publicly"
: "Internally"}
</span>
<span className="text-xs text-gray-500">
commented at
</span>

<span className="text-xs text-gray-500">
{moment(
item.createdAt
).format("DD/MM/YYYY hh:mm")}
</span>
</div>
</div>
<div className="text-sm text-gray-900">
<span>{item.text}</span>
Expand Down Expand Up @@ -1523,7 +1529,16 @@ export default function Ticket() {
)}
{editTime && (
<div>
<div className="mt-2">
<div className="mt-2 flex flex-col">
<input
type="number"
name="number"
id="timespent"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
placeholder="30"
value={timeSpent}
onChange={(e) => setTimeSpent(e.target.value)}
/>
<input
type="number"
name="number"
Expand Down

0 comments on commit 24f2a8a

Please sign in to comment.