mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-24 19:32:10 +00:00
Merge pull request #72 from xarmian/fix/case-insensitive-item-refs
fix: make item ref parsing case-insensitive (BUG-22)
This commit is contained in:
@@ -290,7 +290,9 @@ func (s *Store) ResolveItemIncludeDeleted(workspaceID, slugOrRef string) (*model
|
||||
|
||||
// parseItemRef parses "PREFIX-123" into ("PREFIX", 123, true).
|
||||
// Returns false if the string is not a valid item ref.
|
||||
// Case-insensitive: "task-5", "Task-5", and "TASK-5" all parse to ("TASK", 5, true).
|
||||
func parseItemRef(s string) (string, int, bool) {
|
||||
s = strings.ToUpper(s)
|
||||
idx := strings.LastIndex(s, "-")
|
||||
if idx <= 0 || idx == len(s)-1 {
|
||||
return "", 0, false
|
||||
|
||||
Reference in New Issue
Block a user