Skip to content

Commit

Permalink
🩹 [Patch]: Add Web dependency (#293)
Browse files Browse the repository at this point in the history
## Description

This pull request includes the removal of the `ConvertTo-QueryString`
function, the addition of a module requirement to `Web` for the
`Invoke-GitHubAPI` function.

- Remove `ConvertTo-QueryString` function
- Added a requirement for the 'Web' module with version '1.0.0' for
`Invoke-GitHubApi`.
- Update the `ConvertTo-QueryString` command to
`ConvertTo-WebQueryString` from `Web`.

## Type of change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
  • Loading branch information
MariusStorhaug authored Feb 2, 2025
1 parent 8ac15ed commit 048b37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 56 deletions.
54 changes: 0 additions & 54 deletions src/functions/private/Utilities/Web/ConvertTo-QueryString.ps1

This file was deleted.

6 changes: 4 additions & 2 deletions src/functions/public/API/Invoke-GitHubAPI.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
filter Invoke-GitHubAPI {
#Requires -Modules @{ ModuleName = 'Web'; RequiredVersion = '1.0.0' }

filter Invoke-GitHubAPI {
<#
.SYNOPSIS
Calls the GitHub API using the provided parameters.
Expand Down Expand Up @@ -160,7 +162,7 @@
Write-Debug "Setting per_page to the default value in context [$($Context.PerPage)]."
$Body['per_page'] = $Context.PerPage
}
$queryString = $Body | ConvertTo-QueryString
$queryString = $Body | ConvertTo-WebQueryString
$APICall.Uri = $APICall.Uri + $queryString
} elseif ($Body -is [string]) {
# Use body to create the form data
Expand Down

0 comments on commit 048b37c

Please sign in to comment.