Skip to content

Created an option to view and download file for admins when approving a file. - #200

Open
Deadman1225 wants to merge 3 commits into
Coding-Club-IITG:devfrom
Deadman1225:dev
Open

Created an option to view and download file for admins when approving a file. #200
Deadman1225 wants to merge 3 commits into
Coding-Club-IITG:devfrom
Deadman1225:dev

Conversation

@Deadman1225

Copy link
Copy Markdown
Contributor
  • admin/src/pages/CourseDashboard.jsx -> pending contributions now render each file as its own row with a View link (opens the SharePoint preview via webUrl) and a Download button. Added a handleDownload handler.
  • admin/src/apis/courses.js -> added getFileDownloadUrl(fileId), which calls the existing GET /api/file/download/:fileID
    endpoint.

The Download button sends the file's OneDrive fileId to the existing /api/file/download/:fileID endpoint, which asks Microsoft Graph for a fresh @microsoft.graph.downloadUrl (a direct-to-bytes link) and returns it. The browser is then navigated to that URL to trigger the download.

@Deadman1225

Copy link
Copy Markdown
Contributor Author
Screenshot (191) Screenshot (192) Screenshot (193)

The View option opens the sharepoint link and the download button downloads the file directly.

@DreamBot706

Copy link
Copy Markdown
Contributor

is there a way to see all the unverified files of any course together? can you add this so that admins can approve files in courses without br

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants