feat: show ward in list
This commit is contained in:
parent
db2cfcfb94
commit
3e5b08e264
|
@ -30,6 +30,7 @@ internal class Message {
|
|||
internal class MessageWithTerritory {
|
||||
public Guid Id { get; init; }
|
||||
public uint Territory { get; init; }
|
||||
public uint? Ward { get; init; }
|
||||
public float X { get; init; }
|
||||
public float Y { get; init; }
|
||||
public float Z { get; init; }
|
||||
|
|
|
@ -74,9 +74,14 @@ internal class MessageList : ITab {
|
|||
var territory = this.Plugin.DataManager.GetExcelSheet<TerritoryType>()?.GetRow(message.Territory);
|
||||
var territoryName = territory?.PlaceName.Value?.Name?.ToDalamudString().TextValue ?? "???";
|
||||
|
||||
var loc = $"Location: {territoryName}";
|
||||
if (message.Ward != null) {
|
||||
loc += $" (Ward {message.Ward.Value})";
|
||||
}
|
||||
|
||||
ImGui.TextUnformatted(message.Text);
|
||||
ImGui.TreePush();
|
||||
ImGui.TextUnformatted($"Location: {territoryName}");
|
||||
ImGui.TextUnformatted(loc);
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiHelper.SmallIconButton(FontAwesomeIcon.MapMarkerAlt, $"{message.Id}") && territory != null) {
|
||||
|
|
|
@ -95,7 +95,7 @@ async fn handle_rejection(err: Rejection) -> Result<impl Reply, Infallible> {
|
|||
WebError::NoSuchMessage => (StatusCode::NOT_FOUND, "no_such_message", "no message with that id was found".into()),
|
||||
WebError::InvalidExtraCode => (StatusCode::BAD_REQUEST, "invalid_extra_code", "that extra code was not found".into()),
|
||||
WebError::MissingWard => (StatusCode::BAD_REQUEST, "missing_ward", "a ward was not provided - try updating the plugin".into()),
|
||||
WebError::UnnecessaryWard => (StatusCode::BAD_REQUEST, "unnecessar_ward", "a ward was provided but not necessary - try updating the plugin".into()),
|
||||
WebError::UnnecessaryWard => (StatusCode::BAD_REQUEST, "unnecessary_ward", "a ward was provided but not necessary - try updating the plugin".into()),
|
||||
}
|
||||
} else if err.is_not_found() {
|
||||
(StatusCode::NOT_FOUND, "not_found", "route was unknown to the server".into())
|
||||
|
|
|
@ -39,7 +39,7 @@ async fn logic(state: Arc<State>, id: i64, location: u32, query: GetLocationQuer
|
|||
if !housing && query.ward.is_some() {
|
||||
return Err(warp::reject::custom(WebError::UnnecessaryWard));
|
||||
}
|
||||
|
||||
|
||||
let location = location as i64;
|
||||
let mut messages = sqlx::query_as!(
|
||||
RetrievedMessage,
|
||||
|
@ -62,7 +62,7 @@ async fn logic(state: Arc<State>, id: i64, location: u32, query: GetLocationQuer
|
|||
left join votes v on m.id = v.message
|
||||
left join votes v2 on m.id = v2.message and v2.user = ?
|
||||
inner join users u on m.user = u.id
|
||||
where m.territory = ? and m.ward = ?
|
||||
where m.territory = ? and m.ward is ?
|
||||
group by m.id"#,
|
||||
id,
|
||||
location,
|
||||
|
|
Loading…
Reference in New Issue