Skip to content

Commit

Permalink
Merge pull request #2 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
Enhance saveToTempFile method to accept file extension parameter
  • Loading branch information
phisakel authored Nov 21, 2024
2 parents 1bc777c + feb3335 commit 6951ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/RqesKit/RQESService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public class RQESService: RQESServiceProtocol, @unchecked Sendable {
return try await rqes.calculateHash(request: request, accessToken: accessToken)
}

static func saveToTempFile(data: Data) throws -> URL {
static func saveToTempFile(data: Data, ext: String = ".pdf") throws -> URL {
let tempDir = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
let tempFile = tempDir.appendingPathComponent(UUID().uuidString)
let tempFile = tempDir.appendingPathComponent("\(UUID().uuidString)\(ext)")
try data.write(to: tempFile)
return tempFile
}
Expand Down

0 comments on commit 6951ae1

Please sign in to comment.