Skip to content

Commit

Permalink
Merge pull request #85 from avantifellows/bugfix/regenerate-links
Browse files Browse the repository at this point in the history
Regenerate Quiz for chosen Session
  • Loading branch information
suryabulusu authored Sep 18, 2024
2 parents 4638652 + fa8e604 commit 644aa20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/(home)/Table/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { absoluteLink } from '@/lib/utils';
import { patchSession } from '@/services/services';
import { patchSession, sendRegenerateSns } from '@/services/services';
import { type Session, STATUS } from '@/types';
import { AlertTriangle, Copy, LinkIcon, Loader, MoreHorizontal } from 'lucide-react';
import Link from 'next/link';
Expand Down Expand Up @@ -62,12 +62,12 @@ const TableActions = ({ session }: { session: Session }) => {
{session.is_active ? 'Disable' : 'Enable'} Session
</Button>
</DropdownMenuItem>
{/* <DropdownMenuItem asChild className="cursor-pointer">
<DropdownMenuItem asChild className='cursor-pointer'>
<Button
variant="ghost"
className="w-full focus-visible:ring-0 justify-start font-normal"
variant='ghost'
className='w-full focus-visible:ring-0 justify-start font-normal'
onClick={() => {
sendCreateSns(session.id);
sendRegenerateSns(session.id);
toast.success('Request send successfully', {
description:
'The links will be available/updated shortly. Please refresh the page after a while.',
Expand All @@ -76,7 +76,7 @@ const TableActions = ({ session }: { session: Session }) => {
>
Regenerate Links
</Button>
</DropdownMenuItem> */}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
Expand Down
2 changes: 2 additions & 0 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ export async function createSession(formData: Session) {

export const sendCreateSns = (id?: number) => publishMessage({ action: 'db_id', id });

export const sendRegenerateSns = (id?: number) => publishMessage({ action: 'regenerate_quiz', id });

/**
* Patches a session on the server.
* @param {Session} formData - The session data to be patched.
Expand Down

0 comments on commit 644aa20

Please sign in to comment.