[PR #2045] [MERGED] Load label ID in NewLabels #16199

Closed
opened 2025-11-02 12:04:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2045
Author: @ethantkoenig
Created: 6/23/2017
Status: Merged
Merged: 6/25/2017
Merged by: @lunny

Base: masterHead: fix/new_labels


📝 Commits (1)

  • c0b2ef7 Load label ID in NewLabels

📊 Changes

4 files changed (+25 additions, -6 deletions)

View changed files

📝 models/issue_label.go (+22 -3)
📝 models/issue_label_test.go (+1 -1)
📝 routers/api/v1/repo/label.go (+1 -1)
📝 routers/repo/issue_label.go (+1 -1)

📄 Description

Fix bug in NewLabels(..) where the ID field for the labels were not populated. This caused a problem in the POST /repos/:user/:repo/labels API endpoint, where the response label would have an "id" attribute of 0.

Also update the unit test to check that ID has been populated.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2045 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 6/23/2017 **Status:** ✅ Merged **Merged:** 6/25/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix/new_labels` --- ### 📝 Commits (1) - [`c0b2ef7`](https://github.com/go-gitea/gitea/commit/c0b2ef77496bcc13e137f9aec688e51015620df3) Load label ID in NewLabels ### 📊 Changes **4 files changed** (+25 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `models/issue_label.go` (+22 -3) 📝 `models/issue_label_test.go` (+1 -1) 📝 `routers/api/v1/repo/label.go` (+1 -1) 📝 `routers/repo/issue_label.go` (+1 -1) </details> ### 📄 Description Fix bug in `NewLabels(..)` where the `ID` field for the labels were not populated. This caused a problem in the `POST /repos/:user/:repo/labels` API endpoint, where the response label would have an `"id"` attribute of 0. Also update the unit test to check that `ID` has been populated. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:04:33 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16199